-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
BUG: numpy.array
brings different results with dask.array.array
#28924
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
Comments
Yes, the NumPy results are correct, tuples are considered scalars in this context if the dtype is a structured dtype. Is that simple? No, but it is what it is and I believe always has been. So closing, can reopen if you have an argument why this should be considered wrong/should be changed. |
The problem we're stumbling over is rather the difference in behavior between using >>> import numpy as np
>>> np.array([(1,2),(3,4)], dtype=[('x', '<i4'), ('y', '<i4')])
array([(1, 2), (3, 4)], dtype=[('x', '<i4'), ('y', '<i4')])
>>> np.array([(1,2),(3,4)]).astype([('x','i4'),('y','i4')])
array([[(1, 1), (2, 2)],
[(3, 3), (4, 4)]], dtype=[('x', '<i4'), ('y', '<i4')]) is this expected? |
Yes, it's expected unfortunately. The reason is that, So once you do So basically, the shape of (PS: happy to re-open, the issue. I am less trigger happy if there is a context given ;)) |
Describe the issue:
I found that
numpy.array
will bring different results withdask.array.array
as follow.I wonder whether
numpy
's results are correct?Reproduce the code example:
Error message:
Python and NumPy Versions:
numpy 2.2.4
python 3.10.0 (default, Mar 3 2022, 09:58:08) [GCC 7.5.0]
Runtime Environment:
[{'numpy_version': '2.2.4',
'python': '3.10.0 (default, Mar 3 2022, 09:58:08) [GCC 7.5.0]',
'uname': uname_result(system='Linux', node='rog', release='6.11.0-25-generic', version='#25~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 15 17:20:50 UTC 2', machine='x86_64')},
{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
'found': ['SSSE3',
'SSE41',
'POPCNT',
'SSE42',
'AVX',
'F16C',
'FMA3',
'AVX2',
'AVX512F',
'AVX512CD',
'AVX512_SKX',
'AVX512_CLX',
'AVX512_CNL',
'AVX512_ICL'],
'not_found': ['AVX512_KNL', 'AVX512_KNM']}},
{'architecture': 'SkylakeX',
'filepath': '/home/xxx/anaconda3/envs/dask/lib/python3.10/site-packages/numpy.libs/libscipy_openblas64_-6bb31eeb.so',
'internal_api': 'openblas',
'num_threads': 16,
'prefix': 'libscipy_openblas',
'threading_layer': 'pthreads',
'user_api': 'blas',
'version': '0.3.28'}]
Context for the issue:
No response
The text was updated successfully, but these errors were encountered: