摘要: def dig2chars(s): """ 五百一十二 -->512 一三二 --> 132 """ # 使用unicode编码 fl = unicode(str(s).decode('gbk').encode('utf-8'), 'utf-8') # 先把数字提取 part = re.compil 阅读全文
posted @ 2021-07-19 15:15 Young_Mo 阅读(149) 评论(0) 推荐(0) 编辑
摘要: from pandarallel import pandarallel import pandas as pd pandarallel.initialize(nb_workers=4) res = pd.read_csv('./8.csv', low_memory=False) res['SFRZM 阅读全文
posted @ 2021-07-07 17:47 Young_Mo 阅读(643) 评论(0) 推荐(0) 编辑
摘要: # pandas 查出全部的重复的数据 duplicate = res[res.duplicated(subset=[col])][col].tolist() fin_res = res[res[col].isin(duplicate)]# 当使用dupilcated方法查重时 只会查重重复的数据, 阅读全文
posted @ 2021-07-01 15:59 Young_Mo 阅读(30) 评论(0) 推荐(0) 编辑
摘要: import time import asyncio from concurrent.futures import ThreadPoolExecutor def long_blocking_function(): print(time.time()) time.sleep(2) return Tru 阅读全文
posted @ 2021-05-27 09:22 Young_Mo 阅读(1947) 评论(0) 推荐(0) 编辑
摘要: def numpy_split_pd(df, split_num): # 使用numpy拆分DataFrame 把索引均分 均分后再用索引拆分DataFrame lst_index = list(map(lambda a: a.tolist(), numpy.array_split(df.index 阅读全文
posted @ 2021-05-08 08:54 Young_Mo 阅读(488) 评论(0) 推荐(0) 编辑
摘要: vscode 版本 1.55.2 打开 运行->添加配置(或打开配置) 在launch.json 文件中添加 "args":[ "-arg1","value", "-arg2","value", "-arg3","value", ] 配置完成后 使用Code Runner 插件运行还是不能生效,这时 阅读全文
posted @ 2021-04-26 10:16 Young_Mo 阅读(3044) 评论(0) 推荐(0) 编辑
摘要: 使用dbeaver联网自动下载驱动,一般是最新的驱动,无法连接oracle11g 需要下载对应的驱动文件。 下载地址如下: https://www.oracle.com/cn/database/technologies/enterprise-edition/jdbc.html ojdbc6.jar  阅读全文
posted @ 2021-03-03 16:55 Young_Mo 阅读(2978) 评论(0) 推荐(0) 编辑
摘要: class Typed: def __init__(self,type,name): self.type = type #name 存储变量 self.name = name def __set__(self, instance, value): if not isinstance(value,se 阅读全文
posted @ 2021-01-29 08:53 Young_Mo 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 数据表如下: 现在要把每个学生的三列成绩转换成刚,并对应上各自课程的成绩,语句如下: with test12 as (select '10001' as xh ,'张三' as xm ,'80' as ywkcj ,'90' as yykcj,'100' sxkccjunion all select 阅读全文
posted @ 2020-12-24 17:53 Young_Mo 阅读(530) 评论(0) 推荐(0) 编辑
摘要: import psycopg2 import os path = 'D:\\photo\\' conn = psycopg2.connect(database="****", port='*****', user="***", password="*****", host="202.38.*.*" 阅读全文
posted @ 2020-11-11 11:17 Young_Mo 阅读(319) 评论(0) 推荐(0) 编辑