Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPR: groupby.corrwith #57158

Closed
rhshadrach opened this issue Jan 30, 2024 · 3 comments · Fixed by #58732
Closed

DEPR: groupby.corrwith #57158

rhshadrach opened this issue Jan 30, 2024 · 3 comments · Fixed by #58732
Assignees
Labels
Deprecate Functionality to remove in pandas Groupby Needs Discussion Requires discussion from core team before further action Reduction Operations sum, mean, min, max, etc.
Milestone

Comments

@rhshadrach
Copy link
Member

As far as I can tell, corrwith was added simply because it could be along with other methods on DataFrame. Searching SO gives two results, of which corrwith is not involved in the solution for both. I'm guessing this method really doesn't see much if any use.

It's signature is odd - it pairs each of the groups up with a single DataFrame and aligns them.

df = pd.DataFrame({"a": [1, 1, 1, 2, 2, 2], "b": range(6)})
df2 = pd.DataFrame({"a": [1, 1, 1, 2, 2, 2, 3], "b": [10 - e for e in range(3)] + list(range(3)) + [10]})
gb = df.groupby("a")
print(gb.corrwith(df2))
#      b   a
# a         
# 1 -1.0 NaN
# 2  1.0 NaN

I'm thinking we should deprecate this method.

@rhshadrach rhshadrach added Groupby Deprecate Functionality to remove in pandas Needs Discussion Requires discussion from core team before further action Reduction Operations sum, mean, min, max, etc. labels Jan 30, 2024
@utkarshsen03
Copy link

+1 for deprecation of the method.

@jbrockmendel
Copy link
Member

+1

@pedrocariellof
Copy link
Contributor

Take

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Groupby Needs Discussion Requires discussion from core team before further action Reduction Operations sum, mean, min, max, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants