zl程序教程

您现在的位置是:首页 >  后端

当前栏目

Python使用技巧(三):numpy.savetxt

Pythonnumpy 技巧 使用
2023-09-14 09:09:14 时间

numpy.savetxt(fname, X, fmt=’%.18e’, delimiter=’ ‘, newline=‘n’, header=’’, footer=’’, comments=’# ', encoding=None)

np格式:np.save,  np.load

znp格式:np.savez,  np.load

csv文件:np.savetxt,  np.loadtxt

在这里插入图片描述
See also

save
Save an array to a binary file in NumPy .npy format

savez
Save several arrays into an uncompressed .npz archive

savez_compressed
Save several arrays into a compressed .npz archiv

在这里插入图片描述
解释:
在这里插入图片描述
在这里插入图片描述
参考:
https://numpy.org/doc/stable/reference/generated/numpy.savetxt.html