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

Option to specify correlation type when calling df.pcorr() #337

Open
ozika opened this issue Feb 3, 2023 · 1 comment
Open

Option to specify correlation type when calling df.pcorr() #337

ozika opened this issue Feb 3, 2023 · 1 comment
Assignees
Labels
feature request 🚧 New feature or request

Comments

@ozika
Copy link

ozika commented Feb 3, 2023

Hi!
I think it would be useful to be able to specify the correlation type when calling pcorr() directly as pandas method.

I suppose the only change would be this:
On line 952:

V = self.cov()  # Covariance matrix

to

 if method == "spearman":
    # Convert the data to rank, similar to R cov()
    V = data.rank(na_option="keep").cov()
else:
    V = data.cov()
@raphaelvallat raphaelvallat self-assigned this Feb 12, 2023
@raphaelvallat raphaelvallat added the feature request 🚧 New feature or request label Feb 12, 2023
@raphaelvallat
Copy link
Owner

Hi @ozika,

Yes — please feel free to work on a PR (see contributing guidelines here)!

Thanks,
Raphael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request 🚧 New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants