-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
EnhancementExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.Groupby
Description
Create a property function to decide what to do for EAs in _ea_wrap_cython_operation
for groupby ops.
xref : #43634 (comment)
pandas/pandas/core/groupby/ops.py
Lines 318 to 333 in 439acc9
@final | |
def _ea_wrap_cython_operation( | |
self, | |
values: ExtensionArray, | |
min_count: int, | |
ngroups: int, | |
comp_ids: np.ndarray, | |
**kwargs, | |
) -> ArrayLike: | |
""" | |
If we have an ExtensionArray, unwrap, call _cython_operation, and | |
re-wrap if appropriate. | |
""" | |
# TODO: general case implementation overridable by EAs. | |
if isinstance(values, BaseMaskedArray) and self.uses_mask(): | |
return self._masked_ea_wrap_cython_operation( |
Metadata
Metadata
Assignees
Labels
EnhancementExtensionArrayExtending pandas with custom dtypes or arrays.Extending pandas with custom dtypes or arrays.Groupby