Skip to content

REGR: assignment of pd.NA with enlargement gives object dtype with IntegerArray #47284

Closed
@simonjayhawkins

Description

@simonjayhawkins

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

# gets upcast to object
df = pd.DataFrame({"a": [1, 2, 3]}, dtype="Int64")
df.loc[4] = pd.NA

Issue Description

xref #32346 (comment), #47214

Expected Behavior

In [1]: df = pd.DataFrame({"a": [1, 2, 3]}, dtype="Int64")
...: df.loc[4] = pd.NA

In [2]: df
Out[2]:
a
0 1
1 2
2 3
4

In [3]: df.dtypes
Out[3]:
a Int64
dtype: object

In [4]: pd.version
Out[4]: '1.3.5'

Installed Versions

.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselvesMissing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolateNA - MaskedArraysRelated to pd.NA and nullable extension arraysRegressionFunctionality that used to work in a prior pandas version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions