-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Clean nanops.get_corr_func #33244
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
Conversation
return np.corrcoef(a, b)[0, 1] | ||
|
||
def _kendall(a, b): | ||
# kendallttau returns a tuple of the tau statistic and pvalue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this comment worth retaining?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well, should we also have a comment for spearmanr and np.corrcoef?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have tests for invaid method names?
def func(a, b): | ||
return kendalltau(a, b)[0] | ||
|
||
return func |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would make all of these lambda, e.g.(for all 3 cases)
return lambda a, b: kendaltau(a, b)[0]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hah, i asked for these to be changed from lambda to non-lambdas for nicer tracebacks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh really it does? hmm, ok, then that's fine
There's testing at least for DataFrame.corr (test_corr_invalid_method in /tests/frame/methods/test_cov_corr.py) but not this function directly AFAIK |
thanks |
Small cleaning (instead of creating a dictionary of functions and then returning only one, just return the one)