结构化数组 和 记录数组
为复合的、异构的数据提供了非常有效的存储 (一般使用pandas 的 DataFrame来实现)
传入的dtpye
使用
Numpy数据类型
Character | Description | Example |
---|---|---|
'b' | Byte | np.dtype('b') |
'i' | Signed integer | np.dtype('i4') == np.int32 |
'u' | Unsigned integer | np.dtype('u1') == np.uint8 |
'f' | Floating point | np.dtype('f8') == np.int64 |
'c' | Complex floating point | np.dtype('c16') == np.complex128 |
'S', 'a' | String | np.dtype('S5') |
'U' | Unicode string | np.dtype('U') == np.str_ |
'V' | Raw data (void) | np.dtype('V') == np.void |
生成结构化数组
更高级的复合类型
数据嵌套数据。妈呀。麻了
记录数组:结构化数组的扭转
就是可以像属性 a.shuxing获取而不是a['shuxing']