Skip to content

ENH: Setting diagonal to 1 in corr function #39224

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

Closed
dhalpern opened this issue Jan 17, 2021 · 1 comment
Closed

ENH: Setting diagonal to 1 in corr function #39224

dhalpern opened this issue Jan 17, 2021 · 1 comment
Labels
Duplicate Report Duplicate issue or pull request

Comments

@dhalpern
Copy link

Is your feature request related to a problem?

I often want to use the corr function to also compute distances between columns (e.g. df.corr(method = spicy.spatial.distance.euclidean). However, I noticed that the .corr function always sets the i=j case to 1 (which is incorrect for the distance case) (see here).

Describe the solution you'd like

I realize using this function to compute distances is sort of a non-standard usage but is there any reason to hardcode it? Would it make more sense as a parameter that could be set?

@dhalpern dhalpern added Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 17, 2021
@simonjayhawkins
Copy link
Member

Thanks @dhalpern for the report

see also #25732, #25781

closing as duplicate

@simonjayhawkins simonjayhawkins added Duplicate Report Duplicate issue or pull request and removed Enhancement Needs Triage Issue that has not been reviewed by a pandas team member labels Jan 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate Report Duplicate issue or pull request
Projects
None yet
Development

No branches or pull requests

2 participants