MAINT: != -> not_equal in hamming distance implementation#4293
Merged
argriffing merged 3 commits intoscipy:masterfrom Dec 18, 2014
Merged
MAINT: != -> not_equal in hamming distance implementation#4293argriffing merged 3 commits intoscipy:masterfrom
argriffing merged 3 commits intoscipy:masterfrom
Conversation
Contributor
Author
>>> import numpy as np
>>> from scipy.spatial.distance import hamming
>>> a = np.array([0, 1, 1, 0], dtype=bool)
>>> b = np.array([0, 1, 1], dtype=bool)
>>> hamming(a, b)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
[...] spatial/distance.py", line 369, in hamming
return np.not_equal(u, v).mean()
ValueError: operands could not be broadcast together with shapes (4,) (3,)
>>> hamming(b, b)
0.0
>>> hamming(b, np.logical_not(b))
1.0 |
Contributor
|
Regression test in argriffing#3. |
TST: spatial: regression test for scipygh-4290
Contributor
Author
|
@larsmans Thanks, merged your exception type regression test into this PR. |
argriffing
added a commit
that referenced
this pull request
Dec 18, 2014
MAINT: != -> not_equal in hamming distance implementation
Contributor
Author
|
merged my own PR, yolo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #4290