数据类型,astype 转换数据类型

import numpy as np print ('生成数组时指定数据类型') arr = np.array([1, 2, 3], dtype = np.float64) print (arr.dtype) arr = np.array([1, 2, 3], dtype = np.int32) print (arr.dtype) print ( ) print ('使用astype复制数组并
相关文章
相关标签/搜索