Skip to content
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

Fixes #3156:Categorical.sort_values bug #3168

Merged
merged 2 commits into from
May 17, 2024

Conversation

stress-tess
Copy link
Member

@stress-tess stress-tess commented May 8, 2024

This PR fixes #3156, Categorical.sort bug, changes the name to sort_values, and adds testing

@stress-tess stress-tess changed the title Fixes #3156 - Categorical.sort bug Fixes #3156:Categorical.sort bug May 8, 2024
Copy link
Contributor

@ajpotts ajpotts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Would you be willing to change the name of this function to sort_values to match pandas?

In [32]: c = pd.Categorical(["a","b","a","c"])

In [33]: c.categories
Out[33]: Index(['a', 'b', 'c'], dtype='object')

In [34]: c.sort_values()
Out[34]: 
['a', 'a', 'b', 'c']
Categories (3, object): ['a', 'b', 'c']

@stress-tess
Copy link
Member Author

Looks great!

Would you be willing to change the name of this function to sort_values to match pandas?

In [32]: c = pd.Categorical(["a","b","a","c"])

In [33]: c.categories
Out[33]: Index(['a', 'b', 'c'], dtype='object')

In [34]: c.sort_values()
Out[34]: 
['a', 'a', 'b', 'c']
Categories (3, object): ['a', 'b', 'c']

sure! that sounds like a good idea

@stress-tess stress-tess changed the title Fixes #3156:Categorical.sort bug Fixes #3156:Categorical.sort_values bug May 16, 2024
This PR fixes Bears-R-Us#3156, `Categorical.sort` bug and adds testing
@stress-tess stress-tess added this pull request to the merge queue May 17, 2024
Merged via the queue into Bears-R-Us:master with commit 7411662 May 17, 2024
13 checks passed
@stress-tess stress-tess deleted the 3156_cat_sort_bug branch May 20, 2024 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Categorical.sort bug
3 participants