Last Updated : 15 Jul, 2025
The ndarray.dtype attribute returns the data type of the array’s elements.
This attribute is read-only and cannot be modified directly.
Example Python3
import numpy as geek
arr = geek.array([[0, 1], [2, 3]])
gfg = arr.dtype
print (gfg)
Output :
int64Syntax
How to check the Data Type of NumPy Array ElementsSyntax: numpy.ndarray.dtype
Parameters : None
Return : [numpy dtype object] Return the data-type of the array’s elements.
To check the data type of NumPy array elements we use ndarray.dtype attribute of the NumPy library in Python
Let us look at the example to understand it better.
Python3
import numpy as geek
arr = geek.array([ 0., 1., 2.])
gfg = arr.dtype
print (gfg)
Output :
float64
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4