[2to3, kmeans] Use the integer division to compute the number of clusters
authorSimon Chabot <simon.chabot@logilab.fr>
Tue, 01 Oct 2019 09:13:04 +0200
changeset 561 925941cf5797
parent 560 f59453f407b7
child 562 700dd41dd9d0
[2to3, kmeans] Use the integer division to compute the number of clusters
nazca/rl/blocking.py
--- a/nazca/rl/blocking.py	Fri Sep 06 10:26:59 2019 +0200
+++ b/nazca/rl/blocking.py	Tue Oct 01 09:13:04 2019 +0200
@@ -473,7 +473,7 @@
         idelement = tuple(
             [0 for _ in xrange(len(refset[0][self.ref_attr_index]))])
         # We assume here that there are at least 2 elements in the refset
-        n_clusters = self.n_clusters or (len(refset) / 10 or len(refset) / 2)
+        n_clusters = self.n_clusters or (len(refset) // 10 or len(refset) // 2)
         try:
             kmeans = self.cluster_class(n_clusters=n_clusters)
         except TypeError: