python写txt-把矩阵数据写进txt文件

参考:https://blog.csdn.net/qq_38497266/article/details/88871197

dets = np.array([[1,2],[3,4]])
np.savetxt("E:workspacedets.txt", dets,fmt='%f',delimiter=',')

保存:表示将dets数组保存到指定路径下的txt文件中,格式是浮点型,以逗号为分割符

保存的txt文件结果为:

原文地址:https://www.cnblogs.com/yibeimingyue/p/15233179.html