numpy.dtype.kind
dtype.kind
A character code (one of ‘biufcmMOSUV’) 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
U Unicode
V void
例:
import numpy as np
train_data = [["a","b",1,4,5,6],["a","b",4,5,6,7],["c","d",30,40,50,60]]
np.array(train_data).dtype.kind
结果:
'U'
参考来源:https://docs.scipy.org/doc/numpy-1.15.1/reference/generated/numpy.dtype.kind.html