python练习
文章平均质量分 62
冷淡的蛋黄酱
这个作者很懒,什么都没留下…
展开
-
python正则表达式
正则表达式01 | re.findall( )02.'.'03.[a-z]04.' a[a-z] '05 | ( )括号的作用06 | [Aa]二选一07 | * 匹配一个、多个或没有08 | '|'或01 | re.findall( )import refile = ''poem = open(r'D:\poem.txt')for line in poem: file += lineprint(file)poem.close()# 寻找'wi'字节result = re.fi原创 2021-06-23 22:13:11 · 296 阅读 · 1 评论 -
pandas聚合函数
聚合函数01 | 数据集02 | value_counts( )03 | groupby( ) + count ( )03 | groupby( ) + agg( )04 | groupby( ) + apply01 | 数据集1.来源kaggle:https://www.kaggle.com/harlfoxem/housesalesprediction2.简介这是一份kaggle房屋的数据集,包含21个columnsimport pandas as pddf = pd.read_cs原创 2021-06-20 23:23:12 · 512 阅读 · 9 评论 -
文字识别 / 自动提取收集信息功能
目录01 | 简介02 | 代码实现01 | 简介本功能目的在于提取收据/发票上的信息,用机器代替人的方式,提高工作效率。实现方式是通过cv2模块截取需要的信息,调用百度的api文字识别接口02 | 代码实现1.导入需要的库,包括百度的api接口跟cv2图像截图图库mport cv2from aip import AipOcr# 读取图片,利用imshow显示图片pic = cv2.imread(r'Y:\cut\img1.png')pic = cv2.resize(p.原创 2021-05-16 20:01:55 · 635 阅读 · 2 评论 -
python练习-prat1
目录01 | 转换01 | 转换1.list转换dictimport numpy as npi = ['a','b']# list 转换为字典def to_dictionary(x): random_list = np.random.randint(0,7,2) dict_x = dict(zip(x,random_list)) return dict_xprint(to_dictionary(i))2.DataFrame转换list# cod.原创 2020-12-23 15:31:27 · 128 阅读 · 0 评论