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

Allow different methods of correlation when using corrwith #21925

Closed
dsaxton opened this issue Jul 15, 2018 · 2 comments · Fixed by #22375
Closed

Allow different methods of correlation when using corrwith #21925

dsaxton opened this issue Jul 15, 2018 · 2 comments · Fixed by #22375
Labels
Apply Apply, Aggregate, Transform Enhancement
Milestone

Comments

@dsaxton
Copy link
Member

dsaxton commented Jul 15, 2018

Hi,

The corr method for DataFrames is exceedingly useful, especially since one can specify methods other than the Pearson correlation. I think it would be nice if this same argument were available when using corrwith. Perhaps there is another workaround, but right now if one wants to calculate all the Spearman (say) correlations with a specific variable, it seems necessary to calculate the full Spearman correlation matrix and subset to the column you care about.

Thanks.

@dsaxton dsaxton changed the title Allow different methods of correlation when using corrwith Allow different methods of correlation when using corrwith Jul 15, 2018
@WillAyd
Copy link
Member

WillAyd commented Jul 15, 2018

Seems reasonable - PRs are always welcome

@WillAyd WillAyd added the Apply Apply, Aggregate, Transform label Jul 15, 2018
@samwaterbury
Copy link

Looks like the corr algorithms are written in Cython but corrwith uses a Python implementation of the Pearson calculation. Should be easy enough to add the other coefficient options to the corrwith method but they should probably use Cython implementations too since Spearman and Kendall are relatively complex calculations.

I can take a look at this and see if the algorithms that corr uses can also be reused by corrwith in some way, shouldn't be too tricky

@jreback jreback added this to the 0.24.0 milestone Aug 17, 2018
@jreback jreback modified the milestones: 0.24.0, Contributions Welcome Nov 6, 2018
@jreback jreback modified the milestones: Contributions Welcome, 0.24.0 Dec 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apply Apply, Aggregate, Transform Enhancement
Projects
None yet
5 participants