attribute
A character code (one of ‘biufcmMOSTUV’) identifying the general kind of data.
b | boolean |
i | signed integer |
u | unsigned integer |
f | floating-point |
c | complex floating-point |
m | timedelta |
M | datetime |
O | object |
S | (byte-)string |
T | string (StringDType) |
U | Unicode |
V | void |
>>> import numpy as np
>>> dt = np.dtype('i4')
>>> dt.kind
'i'
>>> dt = np.dtype('f8')
>>> dt.kind
'f'
>>> dt = np.dtype([('field1', 'f8')])
>>> dt.kind
'V'
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/generated/numpy.dtype.kind.html