numpy.
issctype
Determines whether the given object represents a scalar data-type.
If rep is an instance of a scalar dtype, True is returned. If not, False is returned.
Boolean result of check whether rep is a scalar dtype.
See also
issubsctype
issubdtype
obj2sctype
sctype2char
Examples
>>> np.issctype(np.int32) True >>> np.issctype(list) False >>> np.issctype(1.1) False
Strings are also a scalar type:
>>> np.issctype(np.dtype('str')) True