If you want to sort pandas dataframe’s categorical column by a specific ordering such as small, medium, large, use df.col.cat.set_categories() method.
df.col.cat.set_categories()
The code snippet above shows how it works.
DuckDB: Simplify DataFrame Analysis with Serverless SQL
Simplifying Dataset Comparison with Datacompy
Fuzzy Joining Tables with Non-Exact Matching Entries
Your email address will not be published. Required fields are marked *
Name
Email
Website
Save my name, email, and website in this browser for the next time I comment.
Δ