Skip to content

Conversation

@StefRe
Copy link
Contributor

@StefRe StefRe commented Aug 5, 2022

This is a variant of #47846 using the :okexcept: directive instead of try/except as requested by mroeschke.

StefRe added 2 commits July 25, 2022 12:00
Without the addition in the text it‘s unclear, what s.sort_values(inplace=True)
should demonstrate. Show some meaningful output now. Also, when using astype to
contrast ordered/unordered behavior, I think it‘s clearer to use the existing,
unordered Series than to create a new one.
Without the addition in the text it‘s unclear, what s.sort_values(inplace=True)
should demonstrate. Show some meaningful output now. Also, when using astype to
contrast ordered/unordered behavior, I think it‘s clearer to use the existing,
unordered Series than to create a new one.
Use :okexept: directive as requested by mroeschke.
@StefRe StefRe closed this Aug 5, 2022
s = pd.Series(["a", "b", "c", "a"]).astype(CategoricalDtype(ordered=True))
s.sort_values(inplace=True)
s
s.sort_values(ascending=False)
Copy link
Member

Choose a reason for hiding this comment

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

This does not sort inplace, e.g. s is not updated

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.

2 participants