📜  numpy.find_common_type()函数– Python

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

numpy.find_common_type()函数– Python

numpy.find_common_type()函数根据标准强制规则确定通用类型。

代码#1:

# Python program explaining
# numpy.find_common_type() function
            
# importing numpy as geek 
import numpy as geek 
        
gfg = geek.find_common_type([geek.float32], [geek.int64, geek.float64])
      
print (gfg)

输出 :

float32


代码#2:

# Python program explaining
# numpy.find_common_type() function
            
# importing numpy as geek 
import numpy as geek 
        
gfg = geek.find_common_type([geek.float32], [complex])
      
print (gfg)

输出 :

complex128