![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python操作
Mepleleo
这个作者很懒,什么都没留下…
展开
-
Matplotlib 多个子图使用一个图例
Matplotlib 多个子图使用一个图例情况1:所有的子图图例相同import matplotlib.pyplot as pltfig = plt.figure()axes = fig.subplots(nrows=2, ncols=2)for ax in fig.axes: ax.plot([0, 10], [0, 10], label='linear')lines, labels = fig.axes[-1].get_legend_handles_labels()fig.l原创 2021-11-27 11:48:03 · 22064 阅读 · 6 评论 -
python pandas向已有excel添加新表sheet/添加数据
python pandas向已有excel添加新表sheet/添加数据import pandas as pdfrom openpyxl import load_workbookwriter = pd.ExcelWriter(excel_name,engine='openpyxl')# pylint: disable=abstract-class-instantiatedone_img_info = ['file', 1]one_img_info = pd.DataFrame(one_img_in原创 2021-11-17 16:01:18 · 16832 阅读 · 0 评论 -
python对list列表排序,按照列表内字符串的数字
形如这种有多个关键字的listlist = ['a222_1_0.797911.png', 'a222_2_0.845443.png', 'a222_3_0.753170.png', 'a222_4_0.764250.png', 'a222_5_0.785842.png', 'a222_6_0.750649.png', 'a222_7_0.751012.png', 'a222_8_0.761352.png', 'a222_9_0.762369.png', 'a222_10_0.750486.png'原创 2020-11-14 19:03:39 · 1357 阅读 · 0 评论 -
python生成文件夹目录树到txt文件
参考原作者 https://blog.csdn.net/xijuezhu8128/article/details/1061159391. 代码from pathlib import Path #python自带的包tree_str = ''def generate_tree(pathname, n=0): global tree_str if pathname.is_file(): tree_str += ' |' * n + '-' * 4 + pathna原创 2020-11-07 10:58:11 · 526 阅读 · 1 评论