cf.Data.nbytes

Data.nbytes

Total number of bytes consumed by the elements of the array.

Does not include bytes consumed by the array mask

Performance

If the number of bytes is unknown then it is calculated immediately by executing all delayed operations.

Examples

>>> d = cf.Data([[1, 1.5, 2]])
>>> d.dtype
dtype('float64')
>>> d.size, d.dtype.itemsize
(3, 8)
>>> d.nbytes
24
>>> d[0] = cf.masked
>>> print(d.array)
[[-- 1.5 2.0]]
>>> d.nbytes
24