- 博客(6)
- 问答 (8)
- 收藏
- 关注
原创 Pandas 用户手册——表达式求值eval()
结合实际案例,所有操作都是本人亲自实践,作为以后自己使用pandas时的用户手册。目录1 支持的语法2 例子说明3 内容表达4 局部变量5 解析器6 实例分析1 支持的语法pd.eval()具有3个特点:(1)DataFrame数量很大(一般超过10000行)时更高效;(2)基本的运算、布尔表达等速度非常快,具体支持的语法为:算术运算,比如df+2*Pi 比较,比如df>2 列表或元组,比如[1,2] 属性,比如df['A'] 下标表达式,比如d
2021-03-15 22:15:48
1211
1
原创 Pandas 用户手册——初步认识+数据结构
本人将结合实际案例,掌握Pandas的基本操作,所有操作都是本人亲自实践,用时10天左右,作为以后自己使用pandas时的用户手册,现在分享出来。目录第1章 Pandas初步认识1.1 创建对象1.2 查看数据1.3 筛选数据第1章 Pandas初步认识1.1 创建对象一般有两种创建Series和DataFrame的方法,通过字典dict()或者利用Numpy+Index+columns的方法,方法一适合简单的情形,方法二更清晰。import pandas as .
2021-03-15 17:28:20
535
1
原创 pandas.set_option 用法总结
set_option("参数",值):设置pandas的默认参数,在实际应用中会常常遇到,所以本人好好学习了一下API参考文献,结合实际案例进行阐释。下面是原始的案例数据,输出后:1.compute.use_bottleneck:bool...
2021-02-28 10:21:18
4506
3
原创 代码调优策略及方法
1.代码调优策略Much of what you've heard about code tuning is false,reducing the lines of code in a high-level language improves the speed or size of the resulting machine code; certain operations are probably faster or smaller than others; you should optim
2021-01-03 18:32:28
296
原创 24.重构
Reasons to refactor:code is duplicated; A routine is too long; A routine has a poor name; A loop is too long or too deeply nested; A class has poor cohesion; A class interface does not provide a consistent level of abstraction; One class is overly int
2021-01-01 18:22:07
114
原创 基于买方意向的货物撮合交易
本人兴趣爱好参加CCF大数据与计算智能大赛(2020),遇到题目为“基于买方意向的货物撮合交易”,本人用python中的pandas库处理此问题,最后结果可以,但是运行时间太长了,所以请教如何对代码进行优化?import pandas as pdbuyer = pd.read_csv(r'\buyer.csv', header=0, encoding='ANSI', low_memory=False)seller = pd.read_csv(r'\seller.csv', header=0,
2020-12-23 21:40:12
461
1
空空如也
python使用googletrans来翻译,报错
2022-02-25
百度翻译 报错:KeyError: 'trans_result'
2022-01-10
matplotlib:根据二维数组画类似海拔图
2021-10-12
关于torch激活函数自定义
2021-07-07
Pytorch log_prob 出错
2021-07-02
pytorch网络初始化权重
2021-06-24
pylint运行错误
2021-01-22
pandas 提速方法是什么?
2020-12-25
TA创建的收藏夹 TA关注的收藏夹
TA关注的人