🐼🤹♂️ pandas trick:
Two easy ways to reduce DataFrame memory usage:
1. Only read in columns you need
2. Use 'category' data type with categorical data
Example:
df = pd.read_csv('file.csv', usecols=['A', 'C', 'D'], dtype={'D':'category'})
#Python #DataScience
✴️ @AI_Python_EN
Two easy ways to reduce DataFrame memory usage:
1. Only read in columns you need
2. Use 'category' data type with categorical data
Example:
df = pd.read_csv('file.csv', usecols=['A', 'C', 'D'], dtype={'D':'category'})
#Python #DataScience
✴️ @AI_Python_EN