-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Fix bug for kendall corr when in DF num and bool #11560
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
BUG: Fix bug for kendall corr when in DF num and bool #11560
Conversation
if i > j: | ||
continue | ||
elif i == j: | ||
correl[i, i] = 1. |
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.
this is not correct if all of the values are NaN
, then the result is Nan
, so you can check that case or let this fall thru. Pls test for this (if its not done already)
2091994
to
171ec36
Compare
@jreback Jeff, |
171ec36
to
b04da65
Compare
# so it need to be properly handled | ||
df = DataFrame({"a": [True, False], "b": [1, 0]}) | ||
|
||
expected = np.ones((2, 2), dtype=np.float64) |
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.
construct an actual DataFrame
here and use assert_frame_equal
for comparison
couple of comments. pls add a whatsnew (put in bug fixes), use this PR number as the issue number. squash, then ping when green. |
babfe01
to
fe30837
Compare
fe30837
to
f6b11fe
Compare
@jreback Done |
…all-for-num-and-bool BUG: Fix bug for kendall corr when in DF num and bool
thanks! |
@jreback Thank you for pandas! |
Hi,
so
np.isfinite(mat)
will raise Exception.I've fixed this by using
com._ensure_float64
like for other correlation.