-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: Array comparison between numerical and non-numerical returns builtin bool #27271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Milestone
Comments
Thanks for the report, this is indeed an unintentional change and unfortunately already included in numpy 2.0.1. We should get this fixed for 2.0.1 and 2.1.1. |
seberg
pushed a commit
that referenced
this issue
Aug 26, 2024
Mitigates #27271. The underlying issue (an array comparison returning a python bool instead of a numpy bool) is not addressed. The order of statements is slightly reordered, so that the if a1 is a2: check can be done before the calculation of cannot_have_nan
charris
pushed a commit
to charris/numpy
that referenced
this issue
Aug 26, 2024
Backport of numpy#27275 Mitigates numpy#27271. The underlying issue (an array comparison returning a python bool instead of a numpy bool) is not addressed. The order of statements is slightly reordered, so that the if `a1 is a2:` check can be done before the calculation of `cannot_have_nan` Closes numpygh-27271
charris
pushed a commit
to charris/numpy
that referenced
this issue
Aug 26, 2024
Backport of numpy#27275 Mitigates numpy#27271. The underlying issue (an array comparison returning a python bool instead of a numpy bool) is not addressed. The order of statements is slightly reordered, so that the if `a1 is a2:` check can be done before the calculation of `cannot_have_nan` Closes numpygh-27271
DimitriPapadopoulos
pushed a commit
to DimitriPapadopoulos/numpy
that referenced
this issue
Aug 27, 2024
…27275) Mitigates numpy#27271. The underlying issue (an array comparison returning a python bool instead of a numpy bool) is not addressed. The order of statements is slightly reordered, so that the if a1 is a2: check can be done before the calculation of cannot_have_nan
ArvidJB
pushed a commit
to ArvidJB/numpy
that referenced
this issue
Nov 1, 2024
…27275) Mitigates numpy#27271. The underlying issue (an array comparison returning a python bool instead of a numpy bool) is not addressed. The order of statements is slightly reordered, so that the if a1 is a2: check can be done before the calculation of cannot_have_nan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the issue:
Comparing two arrays where one is a string and the other a numerical value returns a builtin bool. This causes the
np.array_equal
method to fail as no.all
method exists.Reproduce the code example:
Error message:
Python and NumPy Versions:
2.1.0
3.12.5 (main, Aug 14 2024, 05:08:31) [Clang 18.1.8 ]
Runtime Environment:
[{'numpy_version': '2.1.0',
'python': '3.12.5 (main, Aug 14 2024, 05:08:31) [Clang 18.1.8 ]',
'uname': uname_result(system='Linux', node='gpu06', release='5.15.0-107-generic', version='#117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024', machine='x86_64')},
{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2'],
'not_found': ['AVX512F',
'AVX512CD',
'AVX512_KNL',
'AVX512_KNM',
'AVX512_SKX',
'AVX512_CLX',
'AVX512_CNL',
'AVX512_ICL']}},
{'architecture': 'Haswell',
'filepath': '/ceph/ssd/staff/gaoni/repos/sacred/.venv/lib/python3.12/site-packages/numpy.libs/libscipy_openblas64_-ff651d7f.so',
'internal_api': 'openblas',
'num_threads': 20,
'prefix': 'libscipy_openblas',
'threading_layer': 'pthreads',
'user_api': 'blas',
'version': '0.3.27'}]
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: