06 2021 档案

摘要:import pymysql # 根据流程# 1.我们先建立数据库的连接信息host = **** # 数据库的ip地址user = *** # 数据库的账号password = *** # 数据库的密码port = 3306 # mysql数据库通用端口号 mysql = pymysql.conn 阅读全文
posted @ 2021-06-30 17:55 新茶煮酒 阅读(185) 评论(0) 推荐(0) 编辑
摘要:1.t1=dfile.drop_duplicates(keep=False) #将重复数据完全去除 2.t2=t1.drop_duplicates(keep='first') #将重复数据保留第一个 3.t2=t1.drop_duplicates(keep='last') #将重复数据保留最后一个 阅读全文
posted @ 2021-06-30 17:54 新茶煮酒 阅读(477) 评论(0) 推荐(0) 编辑
摘要:​ 1.有时候只需要CSV文件中的其中几列数据 ​ 2.read_csv函数中,参数加入usecols=[列坐标1,列坐标2,列坐标3……] df=pd.read_csv(f,encoding='utf-8',usecols=[14,27,28]) ​ 阅读全文
posted @ 2021-06-30 17:52 新茶煮酒 阅读(724) 评论(0) 推荐(0) 编辑
摘要:​ 1、连接数据库 consql = create_engine('mysql+pymysql://root:123456@localhost:3366/policy_total_data', encoding='utf8') 2.使用read_sql函数 db_df1 = pd.read_sql( 阅读全文
posted @ 2021-06-30 17:51 新茶煮酒 阅读(480) 评论(0) 推荐(0) 编辑
摘要:​ 1.原数据以0开头 ​ 2.在read_csv中,加入参数dtype=object df = pd.read_csv('./rate_file/rate_20200216.csv', low_memory=False, sep=',', encoding="UTF-8", header=None 阅读全文
posted @ 2021-06-30 17:50 新茶煮酒 阅读(1037) 评论(0) 推荐(0) 编辑
摘要:如果在只是想匹配模式的上下几行,grep可以实现。 grep -5 'parttern' inputfile //打印匹配行的前后5行 grep -C 5 'parttern' inputfile //打印匹配行的前后5行 grep -A 5 'parttern' inputfile //打印匹配行 阅读全文
posted @ 2021-06-29 16:32 新茶煮酒 阅读(809) 评论(0) 推荐(0) 编辑
摘要:function check(){ expect -c " spawn ssh -A -q -\oStrictHostKeyChecking=no user@IP -t \" sudo timeout 2s sh test.sh \" expect { \"*assword\" { send \"p 阅读全文
posted @ 2021-06-18 19:25 新茶煮酒 阅读(62) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示