From numpy documentation:
numpy.ndarray.nbytes¶ attribute
ndarray.nbytes Total bytes consumed by the elements of the array.
Notes
Does not include memory consumed by non-element attributes of the array object.
The following code:
x = np.zeros((3,5,2), dtype=np.uint64)
x[0].nbytes
Outputs:
80
Why?
Again from numpy documentation:
numpy.uint64: 64-bit unsigned integer