Pandas Series: memory_usage() function

Memory usage of Pandas Series

The memory_usage() function is used to get the memory usage of the Series.

The memory usage can optionally include the contribution of the index and of elements of object dtype.


Series.memory_usage(self, index=True, deep=False)
Pandas Series memory_usage() function


Name Description Type Default Value Required / Optional
index Specifies whether to include the memory usage of the Series index. bool True Required
deep If True, introspect the data deeply by interrogating object dtypes for system-level memory consumption, and include it in the returned value. bool False: 0 Optional

Returns: int - Bytes of memory consumed.


Download the above Notebook from here.

Previous: Series as ndarray or ndarray-like in Pandas
Next: Change data type of a series in Pandas