整理整理.
1. csv
data.to_csv('D:/data.csv',index =None,header=None)
2. txt
数组转为csv格式后保存为txt.
data.to_csv('D:/data.txt',index =None,header=None)
3. 三维数组保存为txt
data3.shape为 [2, 3, 4]
#保存
with open('D:/data3.txt', 'w') as outfile:
for i in data3:
np.savetxt(outfile, i, fmt = '%f', delimiter = ',')
#打开
data3 = np.loadtxt('D:/data3.txt', delimiter = ',').reshape((2,3,4))
就酱ヾ( ̄▽ ̄)Bye~