GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — GH-95861: Add support for Spearman's rank correlation coefficient by rhettinger · Pull Request #95863 · python/cpython Conversation
|
|
See my early comment on #95861 I think we should make |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
If you categorically disagree with my suggestion to make rank public and move spearman into its own named function, I will accept this (you've done the hard work writing the code and I do like the feature). But I do strongly request that we keep to the design of separate named functions rather than overloading the one function with a flag.
If you categorically want to keep the single correlation function, then we could future-proof it and make the type of correlation more explicit with an enumerated flag rather than a bool:
def correlation(x, y, /, kind='pearson'):
if kind == 'spearman':
x = _rank(x)
y = _rank(y)
elif kind != 'pearson':
raise ValueError('unsupported correlation kind')
If we ever add another sort of correlation (say, Kendall tau) is would be awkward to handle a second bool flag.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
When you're done making the requested changes, leave the comment: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you for responding quickly and thoughtfully. I added some comments to the issue to help us get to a good meeting of the minds on the API. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.