numpy.issctype()

numpy.issctype(rep) [source]

Determines whether the given object represents a scalar data-type.

Parameters:

rep : any

If rep is an instance of a scalar dtype, True is returned. If not, False is returned.

Returns:

out : bool

Boolean result of check whether rep is a scalar dtype.

Examples

1
2
3
4
5
6
>>> np.issctype(np.int32)
True
>>> np.issctype(list)
False
>>> np.issctype(1.1)
False

Strings are also a scalar type:

1
2
>>> np.issctype(np.dtype('str'))
True
doc_NumPy
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.