-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Improve sorting in dataframe editor #3240
Conversation
df = DataFrame({'colA': [1, 3], 'colB': ['c', 'a']}) | ||
dfm = DataFrameModel(df) | ||
dfm.sort(2) | ||
print(dfm.df) |
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.
🚫
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.
Yep, please remove it :-)
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.
Oops, I hadn't spotted that I left the print in. It's gone now.
The code looks good to me (minus the debug print). And it even has tests ! @jitseniesen you passed the 10% coverage 😄 |
I like tests, because I make many mistakes! |
- Set ascending flag correctly, fixes spyder-ide#3020. - Use mergesort so that sorting is stable, fixes spyder-ide#3010. - Use .sort_values() because .sort() is deprecated since pandas 0.17.
f2c5d0c
to
dee3d80
Compare
What a nice addition @jitseniesen!! Thanks a lot for helping us with it and for increasing our testing coverage too! Note: I saw you rebased your PR to fix failures in Travis. Usually those failures are caused by random segfaults or tracebacks, so there's no need to worry about that. I usually fix it by launching new builds before merging :-) However, if you want to trigger a new build in Travis and AppVeyor yourself, you can easily do it by closing and opening the PR (instead of rebasing :-). |
Awesome :-) Thanks a lot @jitseniesen |
Thanks, that's good to know. It is a bit annoying that the builds fail that often. |
Yes it is!!!, but sometimes the segfaults in tests... "seem" to be random :-| |
Dataframe editor: Make sorting stable; handle order correctly.
Fixes #3010
Fixes #3020