NumPy

numpy.generic.nbytes

attribute

generic.nbytes

The length of the scalar in bytes.