2021-05-25
python numpy 格式数据存储
假设 train 为 numpy 数据
import numpy
# 假设numpy数据为train
train = numpy. array([1.0, 1.0, 1.0, 1.0, 2.0], detype=float)
法一:tofile\fromfile
train.tofile("filename.bin")
b = numpy.fromfile("filename.bin", detype=float)
# 存储了一个名字为filename.bin的文件
原创
2021-05-25 16:35:59 ·
61 阅读 ·
0 评论