Skip to content

BUG: Identity checking NA in map is incorrect #57390

Open
@mroeschke

Description

@mroeschke
In [2]: pd.Series([pd.NA], dtype="Int64").map(lambda x: 1 if x is pd.NA else 2)
Out[2]: 
0    2
dtype: int64

In pandas 2.1

In [2]: pd.Series([pd.NA], dtype="Int64").map(lambda x: 1 if x is pd.NA  else 2)
Out[2]: 
0    1

This is probably because we call to_numpy before going through map_array

Metadata

Metadata

Assignees

Labels

Arrowpyarrow functionalityNA - MaskedArraysRelated to pd.NA and nullable extension arraysRegressionFunctionality that used to work in a prior pandas version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions