[distances] Use array in favour of deprecated matrix
authorSimon Chabot <simon.chabot@logilab.fr>
Tue, 01 Oct 2019 10:31:23 +0200
changeset 571 b88f18e6b06f
parent 570 a85a6dd27516
child 572 48453d0c1040
[distances] Use array in favour of deprecated matrix see: https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html#array-or-matrix-which-should-i-use
nazca/utils/distances.py
--- a/nazca/utils/distances.py	Tue Oct 01 10:23:44 2019 +0200
+++ b/nazca/utils/distances.py	Tue Oct 01 10:31:23 2019 +0200
@@ -26,7 +26,7 @@
     DATEUTIL_ENABLED = True
 except ImportError:
     DATEUTIL_ENABLED = False
-from scipy import matrix, empty
+from scipy import array, empty
 
 from nazca.utils.normalize import tokenize
 
@@ -103,7 +103,7 @@
     for i in xrange(len(toka)):
         listmatrix.append([distance(toka[i], tokb[j], **kwargs)
                            for j in xrange(len(tokb))])
-    m = matrix(listmatrix)
+    m = array(listmatrix)
     minlist = [m[i, :].min() for i in xrange(m.shape[0])]
     minlist.extend([m[:, i].min() for i in xrange(m.shape[1])])
     return max(minlist)