注意,数组标量并不是dtype对象,虽然很多情况下,可以在需要使用dtype对象的时候都可以使用数组标量。...bytes bytes_
str str_
buffer void
(all others) object_
看下内置Python类型转换的例子:
In [82]: np.dtype(float)...', 'Object0', 'bytes0', 'Bytes0', 'str0', 'Str0', 'void0', 'Void0', 'datetime64', 'Datetime64', 'M8',..._', 'bytes_', 'str_', 'string_', 'int', 'float', 'complex', 'bool', 'object', 'str', 'bytes', 'a'])
使用的例子..., new_dtype)
可以将基本的dtype类型转换为结构化的dtype类型:
In [159]: np.dtype((np.int32,{'real':(np.int16, 0),'imag':(