Skip to content
Related Articles
Open in App
Not now

Related Articles

numpy.dtype.subdtype() function – Python

Improve Article
Save Article
Like Article
  • Last Updated : 18 Jun, 2020
Improve Article
Save Article
Like Article

numpy.dtype.subdtype() function returns Tuple(item_dtype, shape) if this dtype describes a sub-array, and None otherwise.

Syntax : numpy.dtype.subdtype(type)

type : [dtype] The input data-type.
Return : Return Tuple(item_dtype, shape) if this dtype describes a sub-array, and None otherwise.

Code #1 :




# Python program explaining
# numpy.dtype.subdtype() function
         
# importing numpy as geek 
import numpy as geek 
     
x = geek.dtype('8f')
   
gfg = x.subdtype
   
print (gfg)

Output :

(dtype('float32'), (8, ))

 
Code #2 :




# Python program explaining
# numpy.dtype.subdtype() function
         
# importing numpy as geek 
import numpy as geek 
     
x = geek.dtype('i2')
   
gfg = x.subdtype
   
print (gfg)

Output :

None
My Personal Notes arrow_drop_up
Like Article
Save Article
Related Articles

Start Your Coding Journey Now!