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

Comments

Projects
None yet
5 participants
@dsaxton
Copy link

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

This comment has been minimized.

Copy link
Member

commented Jul 15, 2018

Seems reasonable - PRs are always welcome

@WillAyd WillAyd added the Apply label Jul 15, 2018

@samwaterbury

This comment has been minimized.

Copy link

commented Jul 16, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.