numpy.dtype.base()函数Python
numpy.dtype.base()
函数返回子数组的基本元素的 dtype,无论它们的尺寸或形状如何。
Syntax : numpy.dtype.base()
Return : Returns data type of the base element.
代码#1:
# Python program explaining
# numpy.dtype.base() function
# importing numpy as geek
import numpy as geek
x = geek.dtype('i2')
gfg = x.base
print (gfg)
输出 :
int16
代码#2:
# Python program explaining
# numpy.dtype.base() function
# importing numpy as geek
import numpy as geek
x = geek.dtype('8f')
gfg = x.base
print (gfg)
输出 :
float32