Python | numpy.issctype () function



numpy.issctype() is used to determine if a given object represents a scalar data type. If this object represents a scalar data type, it returns true, otherwise it returns false.

Syntax: numpy.issctype (rep)

Parameters:
rep: any input.

Return: [bool] Boolean result of check whether rep is a scalar dtype.

Code # 1:

# Python program explaining
# numpy.issctype () function

 
# numpy import

import numpy as geek

 
# Check if integers are scalar

 

< code class = "plain"> rep = geek.int64

 
# output boolean

out_val = geek.issctype (rep)

print ( "Are integers scalar:" , out_val) 

Output:

 Are integers scalar: True 

Code # 2:

# Python program explaining
# numpy.issctype () function

 
# numpy import

import  numpy as geek

 
# Check if the list is a scalar type

 

rep = [ 1 , 4 , 7 ]

  
# output boolean

out_val = geek.issctype (rep)

print ( "Is list scalar:" , out_val) 

Output:

 Is list scalar: False