From 0867e69d1f21cae22c611612cf9fbe197c09c284 Mon Sep 17 00:00:00 2001 From: Andy Eschbacher Date: Tue, 15 Nov 2016 11:19:15 +0100 Subject: [PATCH] replace plpy method colnames --- src/py/crankshaft/crankshaft/clustering/kmeans.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/py/crankshaft/crankshaft/clustering/kmeans.py b/src/py/crankshaft/crankshaft/clustering/kmeans.py index 383584e..e4fc7e5 100644 --- a/src/py/crankshaft/crankshaft/clustering/kmeans.py +++ b/src/py/crankshaft/crankshaft/clustering/kmeans.py @@ -92,7 +92,9 @@ def _extract_columns(db_resp, id_col_name): id_col_name (string): name of column which has the row id (not a feature of the analysis) """ - return np.array([db_resp[0][c] for c in db_resp.colnames() + keys = [k for k in db_resp[0].keys()] + + return np.array([db_resp[0][c] for c in keys if c != id_col_name], dtype=float).T