Skip to content

Operations between DataFrame and ExtensionArray loses EA dtype #28527

@TomAugspurger

Description

@TomAugspurger

What's the expected behavior here?

In [9]: a = pd.array([1, None, 2, 3], dtype='Int64')

In [10]: df = pd.DataFrame([[1, 2, 3, 4]])

In [11]: (a + df).dtypes
Out[11]:
0      int64
1    float64
2      int64
3      int64
dtype: object

Would we expect the eventual op to dispatch to the ExtensionArray, preserving the Int64Dtype for each?

I believe this is different from #28506

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDtype ConversionsUnexpected or buggy dtype conversionsExtensionArrayExtending pandas with custom dtypes or arrays.Numeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions