When passed 2 arrays of differing length, scipy.spatial.distance.hamming raises:
AttributeError: 'bool' object has no attribute 'mean'
This is due to the way the hamming method calculates distance:
u = _validate_vector(u)
v = _validate_vector(v)
return (u != v).mean()
If the arrays have different lengths a single bool is returned by (u != v), and the mean method excepts. Would it be reasonable to detect length differences explicitly and raise a more meaningful exception?
When passed 2 arrays of differing length,
scipy.spatial.distance.hammingraises:AttributeError: 'bool' object has no attribute 'mean'This is due to the way the hamming method calculates distance:
If the arrays have different lengths a single bool is returned by
(u != v), and the mean method excepts. Would it be reasonable to detect length differences explicitly and raise a more meaningful exception?