📜  numpy.maximum_sctype()函数– Python

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

numpy.maximum_sctype()函数– Python

numpy.maximum_sctype()函数返回与输入相同类型的最高精度的标量类型。

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