![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
liuli_weina
这个作者很懒,什么都没留下…
展开
-
Python 绘图笔记
Python 绘图笔记 一、绘制一个简单图 代码如下(示例): import matplotlib.pyplot as plt import numpy as np result = [] # 统计数据 max_iter_num = * # int类型 ... # 循环内 result.append((a,b,c)) ... result = np.array(result) .... # matplo原创 2021-04-10 16:48:46 · 441 阅读 · 1 评论 -
python 写文件(笔记)
一、写文件 def write_txt(filepath): with open(filepath, 'w') as wf: wf.write('**********\n') wf.write('=======\n') wf.close() write_txt('data.txt') 内容类型(list、dict) 注意:将list、dict的内容转为str类型 (1)list def write_txt(filepath): allUsers_原创 2020-10-23 11:43:14 · 277 阅读 · 3 评论 -
python 读文件(笔记)
一、遍历目标文件下.json类型的所有文件名 使用glob模块获取定义类型的文件,os模块获取文件名 import glob import os url = path +"/*" + file_type for file_utl in glob.glob(url): filename = os.path.basename(file_utl) print(filename ) 对获取的文件名做处理方式 (1)使用os模块,‘D:\Data\0_556_2279086572.json’ 转为原创 2020-10-21 15:36:34 · 449 阅读 · 2 评论