Skip to content

BUG/EA: groupby on an EA should return the EA type #23227

Closed
@jreback

Description

@jreback
In [1]: df = pd.DataFrame({'Int': pd.Series([1, 2, 3], dtype='Int64'), 'A': [1, 2, 1]})
   ...: df
   ...: 
Out[1]: 
  Int  A
0   1  1
1   2  2
2   3  1

In [2]: df.groupby('A').Int.sum()
Out[2]: 
A
1    4
2    2
Name: Int, dtype: int64

[2] should be of type Int64; IOW this aggregation needs to be passed thru to the EA _from_sequence

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDtype ConversionsUnexpected or buggy dtype conversionsExtensionArrayExtending pandas with custom dtypes or arrays.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions