10000 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
@njsmith

Description

@njsmith

(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,).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0