Skip to content

Instantly share code, notes, and snippets.

@petrosDemetrakopoulos
Created September 17, 2022 23:36
Show Gist options
  • Save petrosDemetrakopoulos/f922fe90f3bd01115e80b7db14948a4a to your computer and use it in GitHub Desktop.
Save petrosDemetrakopoulos/f922fe90f3bd01115e80b7db14948a4a to your computer and use it in GitHub Desktop.
Pandas categorical column as category
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