Overview:
-
Hamming distance between two one dimensional arrays of same length is given by the number of places the elements differ.
-
The Scipy function hamming() of the scipy.spatial.distance module returns this difference as a percentage to the length of an array.
Example:
# Example Python program that computes the Hamming # Arrays # Compute the Hamming distance |
Output:
Hamming distance:0.2500 |