Skip to content

BUG: segmentation fault with pd.NA and np.ndarray.__contains__ #31922

Closed
numpy/numpy
#15553
@jorisvandenbossche

Description

@jorisvandenbossche

Testing for membership in an ndarray segfaults:

In [1]: pd.NA in np.array(["a"], dtype=object) 
Segmentation fault (core dumped)

Now, this might be something that needs to be fixed in numpy, as for plain lists it "works":

In [3]: pd.NA in ['a']  
...
TypeError: boolean value of NA is ambiguous

but numpy might not expect an error instead of True/False.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions