![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python数据处理
weixin_38185649
我想:明白事情的意义,明白工作的意义,明白生活的意义,明白人生的意义!
展开
-
统计应用冷热启动时间
将冷热启动时间保存到两个sheet页原创 2022-12-30 20:57:15 · 176 阅读 · 0 评论 -
定时退出while循环的方法
方法一:@echo offsetlocal enabledelayedexpansion for /l %%a in (60,-1,1) do ( adb shell "cat /proc/vmstat | grep pgpgin; cat /proc/vmstat | grep pgpgout" set ss=%%~a if !ss! lss 10 set ss=0%%~a cls & echo save time 00:00:!ss! ping原创 2021-04-12 18:57:00 · 772 阅读 · 0 评论 -
将文本中关键信息保存到Excel表格中
# AFExecuteProcessRequestbegin AFExecuteProcessRequestend# main function:主要实现把txt中的关键数据写入到excel中# coding=utf-8import osimport reimport csvif __name__ == '__main__': html_path = os.getcwd() with open("评估结果.csv", "w", newline="") as csvfile原创 2020-06-12 14:45:08 · 182 阅读 · 0 评论 -
根据图片名的关键词进行分类
import osimport imghdrimport shutilimport statdef move_classification(file_path): arr_files = file_path.split("_") # print(arr_files[1]) # print(images_path) folder_path = os.pat...原创 2020-01-08 18:18:04 · 433 阅读 · 0 评论 -
损坏文件移除脚本
import osimport imghdrimport shutilimport tensorflow as tfdef judge_wrong_file(root_path, file_path):if imghdr.what(file_path) is None:remove(root_path, file_path)else:try:img = tf.io.read_fi...原创 2020-01-07 20:37:28 · 103 阅读 · 0 评论 -
根据特殊符号进行切除并保存到新excel中脚本
import xlrdimport xlwtdef num_cut(): # ---------------------读 # 打开excel文件,创建一个workbook对象,book对象也就是fruits.xlsx文件,表含有sheet名 r_book = xlrd.open_workbook("./cs.xlsx") # xls默认有3个工作簿,She...原创 2019-10-18 15:51:50 · 136 阅读 · 0 评论 -
python进行excel表格数据运算脚本
#! /usr/bin/python# -*- coding: utf-8 -*-# 导入pandas模块import pandasimport xlwtimport xlrddef num_operation(): # 读取excel文件,定位sheet页 df = pandas.read_excel("./cs.xlsx", sheet_name="百分比求平...原创 2019-10-18 11:50:05 · 2568 阅读 · 0 评论 -
测试集等比抽取脚本
import osimport shutildef move_file(path): for root, dir, files in os.walk(path): if len(files) != 0: for file in files[:200]: # 抽取数量 url = os.path.join(ro...原创 2019-10-09 21:34:53 · 82 阅读 · 0 评论 -
图片去重脚本
# -*- coding:utf-8 -*-import osimport hashlibimport sysimport shutil# 1.获取文件的列表def get_file_list(file_path): img_file_paths = [] dir_list = os.listdir(file_path) for dirs in dir_li...原创 2019-09-21 14:40:06 · 447 阅读 · 0 评论 -
linux下图片批量复制脚本
#!/usr/bin/env python3# -*- coding:utf-8 -*- import osf = open('./list.txt', 'r', encoding='utf-8-sig')allLines = f.readlines()for line in allLines: temp_line = line.strip('\n') list_fi...原创 2019-09-21 14:43:56 · 553 阅读 · 0 评论 -
windows下图片批量移动脚本
#!/usr/bin/env python3# -*- coding:utf-8 -*- import osimport shutilimport statdef file_copy(): with open('list.txt', 'r') as f: for line in f.readlines(): filename = li...原创 2019-09-21 14:48:08 · 500 阅读 · 0 评论 -
图片定量抽取脚本
import osimport randomimport shutildef move_file(file_path, tar_path): # 3.填写要复制关键词的list.txt keyword_list = open("list.txt", 'r', encoding='utf-8') lines = keyword_list.readlines() ...原创 2019-09-21 14:53:55 · 234 阅读 · 0 评论 -
批量新建文件夹脚本
#!/usr/bin/env python3# -*- coding:utf-8 -*- import osf = open('./list.txt', 'r', encoding='utf-8-sig')allLines = f.readlines()for line in allLines: temp_line = line.strip('\n') list_fi...原创 2019-09-21 14:58:56 · 733 阅读 · 0 评论 -
图片数量统计脚本
import openpyxlimport osimport xml.dom.minidom as domimport xml.parsers.expat as xpedef get_task_folder(root_path, folder_list=list()): content_list = os.listdir(root_path) for content i...原创 2019-09-21 15:02:35 · 295 阅读 · 0 评论 -
xml坐标数量统计脚本
import openpyxlimport osimport xml.dom.minidom as domimport xml.parsers.expat as xpedef get_task_folder(root_path, folder_list=list()): content_list = os.listdir(root_path) for content i...原创 2019-09-21 15:04:12 · 141 阅读 · 0 评论 -
根据模糊度去模糊图片脚本
#! /usr/bin/python# -*- coding: utf-8 -*-import cv2import osdef variance_of_laplacian(image): # compute the Laplacian of the image and then return the focus # measure, which is simply t...原创 2019-10-08 21:31:51 · 143 阅读 · 0 评论 -
按帧率进行视频切图脚本
#coding:utf-8import osimport argparseimport systry: import cv2except: print("Need to install OpenCV:") print("pip install OpenCV")def readVideo(videoFile, folder, videoName, timeF...原创 2019-10-09 21:29:28 · 377 阅读 · 0 评论 -
英文翻译成中文脚本
import osfrom googletrans import Translatorimport shutilif __name__ == '__main__': translate = Translator() # 1.输入要翻译成中文的文件夹路径 path = ".\\image" for root, dirs, files in os.walk(pa...原创 2019-09-21 14:38:01 · 1212 阅读 · 0 评论