Skip to content

Instantly share code, notes, and snippets.

@YiLi225
Created September 9, 2020 03:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YiLi225/be3a024727e228c15d42a4e72ab3a27d to your computer and use it in GitHub Desktop.
Save YiLi225/be3a024727e228c15d42a4e72ab3a27d to your computer and use it in GitHub Desktop.
## Caveat: (2) columns with unique values
dairy_table['Food'].memory_usage(index=False, deep=True)
Out[120]: 1605
## Convert to category,
dairy_table['Food'].astype('category').memory_usage(index=False, deep=True)
Out[121]: 2262
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment