Python| numpy.issctype()函数
numpy.issctype()
函数用于确定给定对象是否表示标量数据类型。如果给定对象表示标量数据类型,则返回true,否则返回false。
Syntax : numpy.issctype(rep)
Parameters :
rep : any input.
Return : [bool] Boolean result of check whether rep is a scalar dtype.
代码#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