10000 accessing undefined field raises incorrect Exception · Issue #7641 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
accessing undefined field raises incorrect Exception #7641
Closed
@andsok75

Description

@andsok75

In numpy 1.11.0, trying to access an undefined field of a structured array raises ValueError, rather than IndexError as in version 1.8

a = np.empty(1,dtype=[('f','u4')])
a['g']

yields

ValueError Traceback (most recent call last)
in ()
----> 1 a['g']

ValueError: no field of name g

Is that a feature? In any case, shouldn't it raise lookup error instead.

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