📜  Python| numpy.issctype()函数

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

Python| numpy.issctype()函数

numpy.issctype()函数用于确定给定对象是否表示标量数据类型。如果给定对象表示标量数据类型,则返回true,否则返回false。

代码#1:

# Python program explaining
# numpy.issctype() function
  
# importing numpy
import numpy as geek
  
# Checking if integers are scalar type
  
rep = geek.int64
  
# output boolean value
out_val = geek.issctype(rep)
print ("Are integers scalar: ", out_val) 
输出 :
Are integers scalar:  True

代码#2:

# Python program explaining
# numpy.issctype() function
  
# importing numpy
import numpy as geek
  
# Checking if list is scalar type
  
rep =[ 1, 4, 7]
  
# output boolean value
out_val = geek.issctype(rep)
print ("Is list scalar: ", out_val) 
输出 :
Is list scalar:  False