2023年11月10日

Python Tricks

摘要: 1. 同时按照一个list的大小排序两个list def return_sorted_list(cclass): namelist = [] numlist = [] for cat in cclass.cat: namelist.append(cat.catName) numlist.append 阅读全文

posted @ 2023-11-10 10:38 MonsterPPPP 阅读(13) 评论(0) 推荐(0)

【数据处理脚本】字符串

摘要: 1. 检测一个字符串内是否有中文 # 检测字符串是否含有中文 def is_contain_chinese(check_str): for ch in check_str: if u'\u4e00' <= ch <= u'\u9fff': return True return False 2. 去除 阅读全文

posted @ 2023-11-10 10:36 MonsterPPPP 阅读(8) 评论(0) 推荐(0)

【数据可视化】matplotlib画图设置

摘要: 1.全局更改图表外观 plt.style.use("ggplot") 2.全局更改图片内的字体/可每次画图都重新定义一下个性化 plt.rc('font',family='Times New Roman', size=20) 3. 画竖直排列的柱状图 def visualization(nameli 阅读全文

posted @ 2023-11-10 10:28 MonsterPPPP 阅读(45) 评论(0) 推荐(0)

导航