Skip to content

ENH: Move "corrwith" from transformation_kernels to reduction_kernels in groupby.base #31270

Closed
@fujiaxiang

Description

@fujiaxiang

Code Sample

>>> import pandas as pd
>>> pd.__version__
'1.0.0rc0+183.g4da554f75'
>>> df = pd.DataFrame(
...     {
...         "A": [1, 1, 1, 1],
...         "B": [0, 1, 2, 3]
...     }
... )

>>> df
   A  B
0  1  0
1  1  1
2  1  2
3  1  3

>>> df.groupby("A").corrwith(df)  # Clearly corrwith is a reduction rather than transformation
     B   A
A
1  1.0 NaN

On current master (1.0.0rc0+183.g4da554f75) we have "corrwith" in the list of transformation_kernels rather than reduction_kernels within groupby.base.

We probably have to move it and fix any impact it has.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions