- 博客(6)
- 收藏
- 关注
转载 python中的偏函数partial
Python的functools模块提供了很多有用的功能,其中一个就是偏函数(Partial function)。要注意,这里的偏函数和数学意义上的偏函数不一样。在介绍函数参数的时候,我们讲到,通过设定参数的默认值,可以降低函数调用的难度。而偏函数也可以做到这一点。举例如下:int()函数可以把字符串转换为整数,当仅传入字符串时,int()函数默认按十进制转换:>>> int('12345')12345但int()函数还提供额外的base参数,默认值为10。如果传入b
2021-08-04 09:50:23
158
原创 Python multiprocess模块(上)
multiprocess模块一. Process模块介绍 1. 直接使用Process模块创建进程 (1)主进程和子进程 (2)if __name__ == "__main__"语句 2. Process模块参数介绍 函数传参的两种方式 3. Process模块方法介绍 (1)join方法的使用 (2)for循环开启多个进程 4. Process模块属性介绍 5. 在windows中必须把Process()放到if __name__ == "__
2021-07-18 23:16:06
384
原创 PIP 国内升级方法
PIP 国内升级方法1本地升级pip国内的一些镜像阿里云 http://mirrors.aliyun.com/pypi/simple/ 中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/ 豆瓣(douban) http://pypi.douban.com/simple/ 清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ 中国科学技术大学 http://pypi.mirrors.ustc.edu.cn
2020-07-06 00:23:35
419
原创 Openpyxl操作手册
openpyxl官方手册教程 Tutorial创建excel文件 Create a workbookThere is no need to create a file on the filesystem to get started with openpyxl. Just import theWorkbookclass and start work:开始使用openpyxl...
2020-04-28 11:36:58
1188
原创 如何使用Pandas的ExcelWriter进行excel操作
pandas ExcelWriter定制格式(定制表头、渲染颜色等,非ExcelWriter标准的创建模式)ExcelWriter这个插件有个坑,就是已经设置好的格式是无法更改的,因此,由pandas转成excel的时候,必须将格式清除,尤其是表头的格式,代码如下:import pandas.io.formats.excelpandas.io.formats.excel.header_...
2020-03-06 00:07:13
60537
4
原创 Impala连接-依赖库SASL 安装细节
在python安装impala包的过程中,会要求安装sasl。而太高版本的sasl在调用impala时会发生会发生报错。所以需要使用低版本的sasl。以下为版本不对时,安装sasl的情况:因此,可以去以下网站寻找对应合适的sasl:https://www.lfd.uci.edu/~gohlke/pythonlibs/在这里可以找到对应python版本和系统版本的sasl轮子...
2020-03-04 09:59:04
1340
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人