数据的csv文件存取
np.savetext(frame,array,fmt='%.18e', delimiter分割字符串=None) 实现存储
np.loadtxt(frame, dtype=np.float, delimiter=None, unpack=False) 实现读取
但是CSV只能有效存储一维和二维数组
多维数据存取
a.tofile(frame, sep='', format='%s')数组存储
np.fromfile(frame, dtype=float, count=‐1读入整个文件, sep='')数组读取
注意:无论是tofile还是fromfile在使用时需要配套使用,其文件数组的维度和元素类型需要一致。
便捷文件存取np.save(fname,array) np.load(fname)