上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: 1. 时间戳-->时间 time_stamp = 1677895200000 # 2023-03-04 10:00:00 pd.to_datetime(time_stamp, unit='ms') # Timestamp('2023-03-04 02:00:00') utc时间 pd.to_date 阅读全文
posted @ 2023-03-10 14:59 是阿杰呀 阅读(253) 评论(0) 推荐(0)
摘要: 1. dataframe --> dict import pandas as pd df = pd.read_csv(file_path, sep=sep) # sep: 间隔字符 df.to_dict(orient='dict') # 默认dict # {'time': {0: "-3'", 1: 阅读全文
posted @ 2023-03-02 18:14 是阿杰呀 阅读(285) 评论(0) 推荐(0)
摘要: re split 分割字符串 line = 'Name: CAPTEX; Start time: 1983/09/18; End time: 1983/10/31; unit: pg/m3; Path:\datem\exp_data\captex\meas-t1.txt;' list1 = re.s 阅读全文
posted @ 2023-02-23 14:54 是阿杰呀 阅读(87) 评论(0) 推荐(0)
摘要: draw_gif.py import os import io import imghdr import imageio.v2 as imageio from PIL import Image, ImageDraw, ImageFont import numpy as np from PIL imp 阅读全文
posted @ 2023-02-01 10:00 是阿杰呀 阅读(340) 评论(0) 推荐(0)
摘要: traceback使用 import traceback import os from pathlib import Path from io import StringIO fp = StringIO() # 使用内存 try: print(' ') int('abc') except: # tr 阅读全文
posted @ 2023-01-06 10:53 是阿杰呀 阅读(93) 评论(0) 推荐(0)
摘要: pandas 读取/保存数据 import pandas as pd file = r'' df = pd.read_excel(file) df_columns = df.columns.to_list() # 字段名list redundant_column = ['name', 'age'] 阅读全文
posted @ 2023-01-06 10:49 是阿杰呀 阅读(459) 评论(0) 推荐(0)
摘要: 1. random随机生成多位数字 import random str1 = ''.join([str(i) for i in random.sample(range(0,9), 6)]) # 随机生成六位 阅读全文
posted @ 2023-01-06 10:27 是阿杰呀 阅读(175) 评论(0) 推荐(0)
摘要: subprocess使用 import subprocess p = subprocess.Popen('ls -l', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, bufsize=1) bufsize: 缓冲区大小. 当创 阅读全文
posted @ 2022-12-16 16:08 是阿杰呀 阅读(119) 评论(0) 推荐(0)
摘要: 1. 管理员权限打开 powershell 2. 打开 winrm服务 查看 winrm service的运行状态, 默认情况没有开启, 执行命令为空 代表没有启动. winrm enumerate winrm/config/listener 对 winrm service进行配置 winrm qu 阅读全文
posted @ 2022-12-16 12:39 是阿杰呀 阅读(932) 评论(0) 推荐(0)
摘要: 1. 连接 linux import paramiko # pip install paramiko def main(ip, port, username, password): res_data = [] ssh = paramiko.SSHClient() ssh.set_missing_ho 阅读全文
posted @ 2022-12-13 14:56 是阿杰呀 阅读(446) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页