numpy.sctype2char(sctype)
[source]
Return the string representation of a scalar dtype.
Parameters: |
sctype : scalar dtype or object If a scalar dtype, the corresponding string character is returned. If an object, |
---|---|
Returns: |
typechar : str The string character corresponding to the scalar type. |
Raises: |
ValueError If |
See also
>>> for sctype in [np.int32, float, 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'
© 2008–2017 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.14.2/reference/generated/numpy.sctype2char.html