mirror of
https://github.com/life4/textdistance.git
synced 2021-09-19 22:35:47 +03:00
Fix numpy warnings regarding numpy.int
DeprecationWarning: `np.int` is a deprecated alias for the builtin `int`.
This commit is contained in:
@@ -137,7 +137,7 @@ class DamerauLevenshtein(_Base):
|
||||
|
||||
def _numpy(self, s1, s2):
|
||||
# TODO: doesn't pass tests, need improve
|
||||
d = numpy.zeros([len(s1) + 1, len(s2) + 1], dtype=numpy.int)
|
||||
d = numpy.zeros([len(s1) + 1, len(s2) + 1], dtype=int)
|
||||
|
||||
# matrix
|
||||
for i in range(-1, len(s1) + 1):
|
||||
|
||||
@@ -142,7 +142,7 @@ class Editex(_Base):
|
||||
len_s1 = len(s1) - 1
|
||||
len_s2 = len(s2) - 1
|
||||
if numpy:
|
||||
d_mat = numpy.zeros((len_s1 + 1, len_s2 + 1), dtype=numpy.int)
|
||||
d_mat = numpy.zeros((len_s1 + 1, len_s2 + 1), dtype=int)
|
||||
else:
|
||||
d_mat = defaultdict(lambda: defaultdict(int))
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class LCSSeq(_BaseSimilarity):
|
||||
http://rosettacode.org/wiki/Longest_common_subsequence#Dynamic_Programming_8
|
||||
"""
|
||||
if numpy:
|
||||
lengths = numpy.zeros((len(seq1) + 1, len(seq2) + 1), dtype=numpy.int)
|
||||
lengths = numpy.zeros((len(seq1) + 1, len(seq2) + 1), dtype=int)
|
||||
else:
|
||||
lengths = [array('L', [0] * (len(seq2) + 1)) for _ in range(len(seq1) + 1)]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user