Thanks to visit codestin.com
Credit goes to github.com

Skip to content

BUG: the result of a complex indexing operation is incorrect #26184

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

Closed
jtc1246 opened this issue Mar 31, 2024 · 2 comments
Closed

BUG: the result of a complex indexing operation is incorrect #26184

jtc1246 opened this issue Mar 31, 2024 · 2 comments
Labels
33 - Question Question about NumPy usage or development

Comments

@jtc1246
Copy link

jtc1246 commented Mar 31, 2024

Describe the issue:

a = np.zeros((10, 20, 4, 30, 40, 3), dtype='uint64')
x1 = a[3, (5, 2), (False, True, False, True), (5,), 2]
x1.shape

The result of this should be (2,2,1,3), but actually it is (2,3).

Reproduce the code example:

import numpy as np
a=np.zeros((10, 20, 4, 30, 40, 3), dtype='uint64')
x1 = a[3, (5, 2), (False, True, False, True), (5,), 2]
print(x1.shape)

Error message:

No response

Python and NumPy Versions:

print(numpy.version)
1.26.0
print(sys.version)
3.9.18 (main, Aug 25 2023, 13:20:14)
[GCC 11.4.0]

Runtime Environment:

[{'numpy_version': '1.26.0',
  'python': '3.9.18 (main, Aug 25 2023, 13:20:14) \n[GCC 11.4.0]',
  'uname': uname_result(system='Linux', node='jtc', release='6.2.0-34-generic', version='#34~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep  7 13:12:03 UTC 2', 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': 'Zen',
  'filepath': '/home/jtc/.local/lib/python3.9/site-packages/numpy.libs/libopenblas64_p-r0-0cf96a72.3.23.dev.so',
  'internal_api': 'openblas',
  'num_threads': 12,
  'prefix': 'libopenblas',
  'threading_layer': 'pthreads',
  'user_api': 'blas',
  'version': '0.3.23.dev'}]
None

Context for the issue:

Actually I am implementing my own memmap algorithm with direct IO. I want to compare its result with np.memmap to check whether it is correct. Then I just encountered this issue.

@seberg seberg added 33 - Question Question about NumPy usage or development and removed 00 - Bug labels Apr 1, 2024
@rgommers rgommers changed the title BUG: the result of complex subscription is incorrect BUG: the result of a complex indexing operation is incorrect Apr 1, 2024
@rkern
Copy link
Member

rkern commented Apr 3, 2024

The result looks correct according to the semantics that are documented for this case. It looks like you want a different set of semantics that have been considered and largely agreed to, but the development work for it has stalled. #6075

@seberg
Copy link
Member

seberg commented Apr 9, 2024

I'll close the issue, since I think the links are sufficient. I'll additionally mention np.ix_ which I think exists basically to simplify what you want.

@seberg seberg closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
33 - Question Question about NumPy usage or development
Projects
None yet
Development

No branches or pull requests

3 participants