热线电话:13121318867

登录
2019-07-04 阅读量: 1144
转换数组可以用这几个函数

ndarray.item(*参数)将数组元素复制到标准Python标量并返回它。

ndarray.tolist()将数组作为(可能是嵌套的)列表返回。

ndarray.itemset(*参数)将标量插入数组(如果可能,将标量转换为数组的dtype)

ndarray.tostring([订购])构造包含数组中原始数据字节的Python字节。

ndarray.tobytes([订购])构造包含数组中原始数据字节的Python字节。

ndarray.tofile(fid [,sep,format])将数组作为文本或二进制写入文件(默认)。

ndarray.dump(文件)将数组的pickle转储到指定的文件。

ndarray.dumps()以字符串形式返回数组的pickle。

ndarray.astype(dtype [,order,cast,...])数组的副本,强制转换为指定的类型。

0.0000
3
关注作者
收藏
评论(0)

发表评论

暂无数据