)
# 每个数据类型都可用作转换函数
>>> float64(42)
42.0
>>> int8(42.0)
42
>>> bool(42)
True
>>> bool(0)
False
>>> bool...recent call last):
File "", line 1, in
TypeError: can't convert complex to int
数据类型对象...(dtype)
# 从数值类型构造
>>> dtype(float)
dtype('float64')
# 从字符代码构造
>>> dtype('f')
dtype('float32')
>>> dtype...('d')
dtype('float64')
# 从双字符代码构造
>>> dtype('f8')
dtype('float64')
# 获取所有字符代码
>>> sctypeDict.keys()..., 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,14, 15, 16,
17, 18, 19, 20, 21, 22, 23])
# flatten 将数组展开