ENH: showing memory used · Issue #6852 · pandas-dev/pandas (original) (raw)
maybe a function nbytes()
to return memory usage
maybe as a tuple : the Series in [6] and then a series of the axis data?
In [5]: df = DataFrame({ 'float' : np.random.randn(1000), 'int' : np.random.randint(0,5,size=1000), 'date' : Timestamp('20130101'), 'string' : 'foo' })
In [6]: Series(dict([ (b.dtype,b.values.nbytes) for b in df._data.blocks ]))
Out[6]:
datetime64[ns] 8000
int64 8000
float64 8000
object 8000
dtype: int64
In [7]: df.index.nbytes
Out[7]: 8000
In [8]: df.columns.nbytes
Out[8]: 32