问题:如何将array保存到txt文件中?如何将存到txt文件中的数据读出为ndarray类型?...python如何保存矩阵,保存matrix,保存numpy.ndarray
分析
a = np.arange(0,12,0.5).reshape(4,-1)
np.savetxt("a.txt",...3., 3., 4., 4.],
[ 5., 5., 6., 6., 7.],
[ 7., 8., 8., 9., 9.]])
np.savez 多个数组保存...如果你想将多个数组保存到一个文件中的话,可以使用numpy.savez函数。...因此这种方式建议在不需要看保存文件内容的情况下使用。