📌  相关文章
📜  numpy.dtype.subdtype()函数– Python

📅  最后修改于: 2022-05-13 01:54:45.872000             🧑  作者: Mango

numpy.dtype.subdtype()函数– Python

numpy.dtype.subdtype() ) 如果此 dtype 描述子数组,则函数返回 Tuple(item_dtype, shape),否则返回 None。

代码#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)

输出 :

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


代码#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)

输出 :

None