Python打开文件,将list、numpy数组内容写入txt文件中的方法
作者:garfielder007 时间:2023-12-16 21:23:17
python保存numpy数据:
numpy.savetxt("result.txt", numpy_data);
保存list数据:
file=open('data.txt','w')
file.write(str(list_data));
file.close()
来源:https://blog.csdn.net/GarfieldEr007/article/details/51264686
标签:Python,list,numpy,txt
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
JavaScript中的onerror事件概述及使用
2024-05-03 15:06:39
![](https://img.aspxhome.com/file/2023/8/130528_0s.jpg)
python自动化之Ansible的安装教程
2023-06-28 13:58:23
Python Numpy实现计算矩阵的均值和标准差详解
2021-12-20 09:51:20
![](https://img.aspxhome.com/file/2023/7/92317_0s.png)
javascript trim、left、right等函数,兼容IE,FireFox
2009-09-18 14:55:00
Python实现串口通信(pyserial)过程解析
2021-10-11 01:49:14
asp中提取HTML中图片的SRC路径
2008-10-24 08:42:00
标志设计如何正确使用字体
2009-02-16 15:41:00
![](https://img.aspxhome.com/file/UploadPic/20092/16/01-71s.jpg)
python urllib库的使用详解
2021-06-12 14:42:04
![](https://img.aspxhome.com/file/2023/8/88918_0s.jpg)
深入研究Application和Session对象
2008-10-13 08:30:00
Python 串口读写的实现方法
2021-04-24 13:25:12
![](https://img.aspxhome.com/file/2023/4/71994_0s.jpg)
基于go-cqhttp与Flask搭建定制机器人项目实战示例
2024-04-26 17:30:32
![](https://img.aspxhome.com/file/2023/4/134024_0s.png)
sqlserver合并DataTable并排除重复数据的通用方法分享
2012-01-05 18:59:56
SQL语句实现查询Index使用状况
2024-01-24 13:44:46
Spring Data JPA的Audit功能审计数据库的变更
2024-01-21 18:30:29
![](https://img.aspxhome.com/file/2023/2/81932_0s.png)
Python如何在DataFrame增加数值
2021-07-23 12:56:29
刷新页面的几种方法小结(JS,ASP.NET)
2024-05-28 15:37:33
解决python给列表里添加字典时被最后一个覆盖的问题
2022-08-24 17:18:42
Bootstrap源码解读按钮(5)
2023-08-23 01:16:51
SqlServer提示“列前缀tempdb.无效: 未指定表名”问题解决方案
2024-01-14 04:39:41
解读tf.keras.layers模块中的函数
2023-04-02 04:26:29