From 5d2a1881b1ed52b8bc4cc555762b60ceb6c16164 Mon Sep 17 00:00:00 2001 From: Andy Eschbacher Date: Thu, 13 Oct 2016 15:00:28 +0000 Subject: [PATCH] make numpy with global scope in module --- src/py/crankshaft/crankshaft/clustering/kmeans.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/py/crankshaft/crankshaft/clustering/kmeans.py b/src/py/crankshaft/crankshaft/clustering/kmeans.py index c99ded1..18a711f 100644 --- a/src/py/crankshaft/crankshaft/clustering/kmeans.py +++ b/src/py/crankshaft/crankshaft/clustering/kmeans.py @@ -1,6 +1,6 @@ from sklearn.cluster import KMeans import plpy - +import numpy as np def kmeans(query, no_clusters, no_init=20): """ @@ -39,7 +39,6 @@ def kmeans_nonspatial(query, colnames, num_clusters=5, num_clusters (int): number of clusters (greater than zero) id_col (string): name of the input id_column """ - import numpy as np out_id_colname = 'rowids' # TODO: need a random seed?