numpy数据类型转换
使用 dtype 或者 astype 可以将numpy数组从类型X(如float)转换为类型Y(如uint8)
>>> A=np.array([ 1.2, 3., 5 ])
>>> A.dtype
dtype('float64')
使用 dtype 或者 astype 可以将numpy数组从类型X(如float)转换为类型Y(如uint8)
>>> A=np.array([ 1.2, 3., 5 ])
>>> A.dtype
dtype('float64')