memory_usage(self, index: 'bool' = True, deep: 'bool' = False) -> 'int'
The memory usage can optionally include the contribution of the index and of elements of :None:None:`object`
dtype.
Specifies whether to include the memory usage of the Series index.
If True, introspect the data deeply by interrogating :None:None:`object`
dtypes for system-level memory consumption, and include it in the returned value.
Bytes of memory consumed.
Return the memory usage of the Series.
DataFrame.memory_usage
Bytes consumed by a DataFrame.
numpy.ndarray.nbytes
Total bytes consumed by the elements of the array.
>>> s = pd.Series(range(3))
... s.memory_usage() 152
Not including the index gives the size of the rest of the data, which is necessarily smaller:
This example is valid syntax, but we were not able to check execution>>> s.memory_usage(index=False) 24
The memory footprint of :None:None:`object`
values is ignored by default:
>>> s = pd.Series(["a", "b"])This example is valid syntax, but we were not able to check execution
... s.values array(['a', 'b'], dtype=object)
>>> s.memory_usage() 144This example is valid syntax, but we were not able to check execution
>>> s.memory_usage(deep=True) 244See :
The following pages refer to to this document either explicitly or contain code examples using this.
pandas.core.frame.DataFrame.memory_usage
pandas.core.series.Series.info
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them