-
Notifications
You must be signed in to change notification settings - Fork 358
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
DataFrame.reindex supports koalas Index parameter #1741
Conversation
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.
Otherwise, seems fine to me.
74daed9
to
3a9c0aa
Compare
self.assert_eq( | ||
pdf.reindex(index=pdf2.index, fill_value=0.0).sort_index(), | ||
kdf.reindex(index=kdf2.index, fill_value=0.0).sort_index(), | ||
) |
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.
Also what if the given index is MultiIndex
?
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.
Thanks for noticing, I updated PR so it has the same behavior of pandas, considering we currently can only reindex single level index.
pdf2 = pd.DataFrame({"a": [1.0, 2.0, 3.0, 4.0, 5.0]}, index=index2) | ||
kdf2 = ks.from_pandas(pdf2) |
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 guess we can just use Index
?
pindex2 = pd.Index(["A", "C", "D", "E", "0"])
kindex2 = ks.from_pandas(pindex2)
I updated with named Actually I think we could also support |
876943f
to
0292c95
Compare
0292c95
to
edf9679
Compare
Hi, I updated PR to fully support MultiIndex.
|
006c13d
to
afeffb6
Compare
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.
Sorry for the delay. I left some comments. Thanks!
1945dae
to
071f812
Compare
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.
Otherwise, LGTM.
071f812
to
fd1c41b
Compare
Thanks! merging. |
Thanks ! :) |
This PR would close #1740.