-
-
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
DataFrame editor should do a stable sort #3010
Comments
I don't understand what you mean. Please post examples about what problem are you seeing and what's the expected output, as it's explicitly demanded in our issue template. Also, for next time, please don't dismiss the template contents. That saves us a lot of time. |
You are right. Strangely, I cannot come up with a small example. I will reopen this when I find an example again. |
Ok, I've got it now:
Expected result: df is hierarchically sorted by the columns '0' and '1'. Observed result: Within the value '2' of column '0', the values of column '1' have become unsorted again. Interestingly, the hierarchical sorting works for smaller DataFrames, e.g. when |
I think this is quite easy to implement by using telling DataFrame.sort to use mergesort (which is stable) in the dataframe editor. A potential problem is that mergesort has a higher memory cost according to the numpy manual, but I don't think that's likely to be an issue for us. |
PR coming? ;-) |
@ccordoba12 Admit it, it's an automated answer ! ;o) |
- 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.
- 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.
I am using Spyder 2.3.5.2 from WinPython-64bit-3.4.3.5.
I noticed that clicking column headers in the DataFrame editor does not sort the table in a stable way. This especially means that one cannot reach a hierarchical sorting.
The text was updated successfully, but these errors were encountered: