Data Type Objects

Instances of numpy.dtype class are called Data Type Objects. Each element of a NumPy array has the same data type. The data type object can tell you the size of the data in bytes which is given by the itemsize property of the dtype class.

import numpy as np

a = np.arange(5, dtype='f')
a.dtype.itemsize

#out
4

Leave a Reply