Return the string representation of a scalar dtype.
Parameters: | sctype : scalar dtype or object
|
---|---|
Returns: | typechar : str
|
Raises: | ValueError :
|
See also
Examples
>>> for sctype in [np.int32, np.float, np.complex, np.string_, np.ndarray]:
... print np.sctype2char(sctype)
l
d
D
S
O
>>> x = np.array([1., 2-1.j])
>>> np.sctype2char(x)
'D'
>>> np.sctype2char(list)
'O'