Friday, October 17, 2025
HomeLanguagesnumpy.ndarray.dtype() function – Python

numpy.ndarray.dtype() function – Python

numpy.ndarray.dtype() function return the data-type of the array’s elements.

Syntax : numpy.ndarray.dtype()

Parameters : None

Return : [numpy dtype object] Return the data-type of the array’s elements.

Code #1 :




# Python program explaining
# numpy.ndarray.dtype() function
         
# importing numpy as geek 
import numpy as geek 
     
arr = geek.array([[0, 1], [2, 3]])
   
gfg = arr.dtype
   
print (gfg)


Output :

int64

 
Code #2 :




# Python program explaining
# numpy.ndarray.dtype() function
         
# importing numpy as geek 
import numpy as geek 
     
arr = geek.array([  0.1.2.])
   
gfg = arr.dtype
   
print (gfg)


Output :

float64
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS