numpy.maximum_sctype()函数– Python
numpy.maximum_sctype()
函数返回与输入相同类型的最高精度的标量类型。
Syntax : numpy.maximum_sctype(t)
Parameters :
t : [dtype or dtype specifier] The input data type. This can be a dtype object or an object that is convertible to a dtype.
Return : [dtype] The highest precision data type of the same kind as the input.
代码#1:
# Python program explaining
# numpy.maximum_sctype() function
# importing numpy as geek
import numpy as geek
gfg = geek.maximum_sctype(int)
print (gfg)
输出 :
class 'numpy.int64'
代码#2:
# Python program explaining
# numpy.maximum_sctype() function
# importing numpy as geek
import numpy as geek
gfg = geek.maximum_sctype('f4')
print (gfg)
输出 :
class 'numpy.float128'