-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: cut does not respect order of passed labels #16459
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
Comments
|
I'm looking into this.
|
If I have a categorical, and I want it to be ordered, and I pass a list of strings as labels, it doesn't seem like I'd ever want the sorted version of those labels to be my rank ordering. Is there a case where I'd actually want to sort those strings alphabetically? |
@economy |
So, if I'm reading this correctly, updating the test to explicitly set |
I think we need a new test in Ideally you would
|
@TomAugspurger, I can create a new test for this, but If I update |
Do you mean the one reported by @ProsperousHeart? That is a doctest, which aren't setup to run automatically (yet, @ProsperousHeart is getting them fixed up so that we can do that). In the meantime we need a regular unit test to verify that the fix works. |
closes pandas-dev#16459 Author: economy <[email protected]> This patch had conflicts when merged, resolved by Committer: Jeff Reback <[email protected]> Closes pandas-dev#16466 from economy/fix_cut and squashes the following commits: 29128b3 [economy] comments and whatsnew edits 3898b72 [economy] BUG: fixed wrong order of ordered labels in pd.cut() (cherry picked from commit d419be4)
closes #16459 Author: economy <[email protected]> This patch had conflicts when merged, resolved by Committer: Jeff Reback <[email protected]> Closes #16466 from economy/fix_cut and squashes the following commits: 29128b3 [economy] comments and whatsnew edits 3898b72 [economy] BUG: fixed wrong order of ordered labels in pd.cut() (cherry picked from commit d419be4)
closes pandas-dev#16459 Author: economy <[email protected]> This patch had conflicts when merged, resolved by Committer: Jeff Reback <[email protected]> Closes pandas-dev#16466 from economy/fix_cut and squashes the following commits: 29128b3 [economy] comments and whatsnew edits 3898b72 [economy] BUG: fixed wrong order of ordered labels in pd.cut()
closes pandas-dev#16459 Author: economy <[email protected]> This patch had conflicts when merged, resolved by Committer: Jeff Reback <[email protected]> Closes pandas-dev#16466 from economy/fix_cut and squashes the following commits: 29128b3 [economy] comments and whatsnew edits 3898b72 [economy] BUG: fixed wrong order of ordered labels in pd.cut()
This issue was found when working on #16432
Problem description
When running
pytest -x --doctest-modules core/reshape/tile.py
against the work inside of the "reshape-3439" branch, we see the following:This is backwards.
Expected Output
Should clear this - this is not an issue.
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: