import numpy as np
nparr1=np.arange(0,20).reshape(4,5)
print(nparr1)
#存储 np.savetxt("nparr1.csv",nparr1,fmt="%d",delimiter=",")
# np.savetxt("nparr2.csv",nparr1,fmt="%s")
#保存到同目录下
#读取
nparr2=np.loadtxt("nparr1.csv",delimiter=",")
print(nparr2.astype("int64"))
原文地址:https://www.cnblogs.com/yiyea/p/11441761.html
时间: 2024-11-15 00:22:56