合集-数据处理脚本合集

【脚本】逐行读取txt文件
摘要:file_name = "train_names.txt" video_names = [] with open(file_name,"r" ) as f : for line in f: video_names.append(line.strip("\n")) print(video_names) 阅读全文

posted @ 2023-10-08 16:40 MonsterPPPP 阅读(55) 评论(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 阅读(66) 评论(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 阅读(29) 评论(0) 推荐(0)

导航