![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
Evan_Kuo
这个作者很懒,什么都没留下…
展开
-
python数据库操作之pymysql模块和sqlalchemy模块(项目必备)
参考链接:https://www.cnblogs.com/aylin/p/5770888.html转载 2020-07-08 11:45:52 · 239 阅读 · 0 评论 -
python操作Excel的包 | xlrd | xlxt | openpyxl
转载自https://feiutech.blog.csdn.net/article/details/88941129转载 2020-07-08 11:13:20 · 369 阅读 · 0 评论 -
使用mutable对象作为Python函数参数默认值潜在的危害
[warn]: #0 %{hostname} will be removed in the future. Use “#{Socket.gethostname}” instead这个错是因为fluentd或者本地机器名的方法改变了。原始报错(警告)020-03-10 06:38:40 +0000 [info]: adding match pattern="incentive.app" typ...转载 2020-03-13 18:38:59 · 192 阅读 · 0 评论 -
python中 将json数据转化为excel表格(列表嵌套字典)
代码#!/usr/bin/python2# -*- coding: utf-8 -*-import jsonimport tablib# 获取json数据rows = [{"a": 1}, {"a": 2}, {"a": 3}, {"a": 4}, {"a": 5}]# 将json中的key作为header, 也可以自定义header(列名)header = tuple([i for i in rows[0].keys()])# header = tuple(["a"])dat原创 2020-05-16 11:12:34 · 3312 阅读 · 1 评论 -
Python-基础-时间日期处理小结
【转】Python-基础-时间日期处理小结 http://www.wklken.me/posts/2015/03/03/python-base-datetime.html转载 2019-07-18 15:27:04 · 70 阅读 · 0 评论 -
Mac下Pytorch安装
参考 https://blog.csdn.net/wz22881916/article/details/79824606转载 2019-05-03 17:42:45 · 3013 阅读 · 0 评论 -
Python源码剖析—Set容器
链接: https://fanchao01.github.io/blog/2016/10/24/python-setobject/转载 2019-03-06 15:52:04 · 438 阅读 · 0 评论 -
正向代理和反向代理的区别
一张图简单读懂其余更精彩的内容参考: https://www.jianshu.com/p/208c02c9dd1d转载 2019-01-24 16:17:48 · 112 阅读 · 0 评论 -
Numpy数据类型转换astype报错
一、复现bug程序执行到这一步tmp = np.loadtxt("Day1.TCP.arff.csv", dtype=np.str, delimiter=",") # 读取csv文件data = tmp[1:, :-1].astype(np.int) # str -> int报错:ValueError: invalid literal for int() with base 1...原创 2019-01-03 21:31:17 · 3190 阅读 · 2 评论 -
jupyter错误
报错信息jupyter UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 4: ordinal not in range(128)原因:Jupyter notebook自己的编码问题解决方案:在报错后继续在终端运行$ LANG=zn jupyter-notebook解决...原创 2019-01-03 19:23:14 · 454 阅读 · 0 评论 -
【转】python list元素为dict时的排序
python list元素为dict时的排序 https://blog.csdn.net/alex_my/article/details/48198251转载 2018-12-14 16:13:06 · 281 阅读 · 0 评论 -
【转】Python中的分组函数(groupby、itertools)
Python中的分组函数(groupby、itertools) https://www.cnblogs.com/dreamer-fish/p/5522687.html转载 2018-12-13 14:37:22 · 343 阅读 · 0 评论 -
python变量名中有变量如何初始化及调用
说明:因为工作原因,用的 python2今天写python脚本,需要把配置文件中的几十个id作为名称,新建list,因此需要批量的建立以及调用。方法如下:利用python自带的getattr和setattr方法class TestService(object): def __init__(self): app_id_list = [1, 2, 3, 4, 5,...原创 2018-12-07 17:14:53 · 2584 阅读 · 0 评论 -
mac 安装mysql详细教程
参考链接 https://www.jianshu.com/p/07a9826898c0转载 2018-11-09 13:57:14 · 113 阅读 · 0 评论 -
python计算程序运行时间
一、计算程序前后运行时间代码如下import datetimestart = datetime.datetime.now()# some work runningend = datetime.datetime.now()print (endtime - starttime).seconds二、计算程序运行时CPU的运行时间代码如下import timestart = time...原创 2018-11-06 15:26:48 · 283 阅读 · 0 评论 -
解决办法:datetime.datetime(2018, 10, 30, 14, 9, 0, 669000, tzinfo=tzlocal()) is not JSON serializable
bug起因python 运行json.dumps(dt)报错… raise TypeError(repr(o) + " is not JSON serializable")TypeError: datetime.datetime(2018, 10, 30, 14, 9, 0, 669000, tzinfo=tzlocal()) is not JSON serializable原...原创 2018-10-31 11:36:05 · 7089 阅读 · 0 评论 -
python后台-秋招复习每日温习
秋招复习每日温习包含类别: 1. 算法 2. 数据结构 3. python基础 4. 计算机基础(操作系统,计算机网络) 5. web后台基础 6. shell一、算法快排(一)递归的(二)非递归的二、数据结构三、 python基础四、计算机基础(操作系统,计算机网络)五、web后台基础六、shell...原创 2018-10-06 20:17:20 · 439 阅读 · 0 评论 -
【转】Python yield使用浅析
廖雪峰 https://www.liaoxuefeng.com/article/001373892916170b88313a39f294309970ad53fc6851243000转载 2018-08-03 20:55:31 · 157 阅读 · 0 评论