I have two lists as the following:
ab = {1, -1, -1, -1, 1, 1};
ac = {1, -1, -1, 1, 1, 1};
How I can find the difference (more precisely, the edit distance) between them? In this case the result should be 1, since there is one item difference between ab
and ac
.
Note: in my case, the list elements only take the values 1
and -1
, and both lists are one-dimensional of the same length, but it is always nice to see more general solutions (elements are of Reals
, lists are matrices, etc.).
Thank you.
Comments
Post a Comment