NumPy

Previous topic

numpy.ndarray.base

Next topic

numpy.ndarray.T

This is documentation for an old release of NumPy (version 1.19). Read this page in the documentation of the latest stable release (version 2.2).

numpy.ndarray.dtype

attribute

ndarray.dtype

Data-type of the array’s elements.

Parameters
None
Returns
dnumpy dtype object

See also

numpy.dtype

Examples

>>>
>>> x
array([[0, 1],
       [2, 3]])
>>> x.dtype
dtype('int32')
>>> type(x.dtype)
<type 'numpy.dtype'>