8000 nditer multi_index gives incorrect value for 0-dim arrays · Issue #448 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

nditer multi_index gives incorrect value for 0-dim arrays #448

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
njsmith opened this issue Sep 18, 2012 · 3 comments
Closed

nditer multi_index gives incorrect value for 0-dim arrays #448

njsmith opened this issue Sep 18, 2012 · 3 comments

Comments

@njsmith
Copy link
Member
njsmith commented Sep 18, 2012

(From discussion in #445)

In [32]: a
Out[32]: array(0)

In [33]: a.shape
Out[33]: ()

In [34]: i = np.nditer(a, flags=["multi_index"])

In [35]: i.next()
Out[35]: array(0)

In [36]: i.multi_index
Out[36]: (0,)

In [37]: a[i.multi_index]
IndexError: 0-d arrays can only use a single () or a list of newaxes (and a single ...) as an index

The multi_index here should be (), not (0,).

@87
Copy link
Contributor
87 commented Sep 19, 2012

See #445 and 3043864 for a (new) fix for this issue.

@seberg
Copy link
Member
seberg commented Oct 25, 2013

This has been fixed in master by allowing nditer to be true 0-d.

@seberg seberg closed this as completed Oct 25, 2013
@pranjalmallick
Copy link

I am still getting the same error (I am using python through Anaconda on my Mac). Can anyone please help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
0