Created
September 17, 2022 23:36
-
-
Save petrosDemetrakopoulos/f922fe90f3bd01115e80b7db14948a4a to your computer and use it in GitHub Desktop.
Pandas categorical column as category
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
df['color'] = df['color'].astype('category') | |
print(df.info(memory_usage="deep")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment