Reduce Memory Usage
In this lesson, we show you how to reduce memory usage in pandas.
We'll cover the following...
You may have already noticed that when you load a large file into a DataFrame object, it consumes more memory than you thought. This is a weakness of pandas. But, there are still some methods to reduce memory usage. In this lesson, we’ll you some of those methods.
Type conversion
As we mentioned in the lesson Type conversion, int64
takes much more memory than int8
. When we load data from a CSV file, if we don’t specify the dtype
for each column, the default dtype
...
Access this course and 1400+ top-rated courses and projects.