![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
12_python
码小匠---千少
这个作者很懒,什么都没留下…
展开
-
python日期格式统一化: 各种日期时间格式处理为标准统一日期时间格式
import pandas as pdaa = [ '2021年12月11日 19:19', '2021年12月11日', "2021-11-24 19:40", "11/1/2018", "06-02-20",]for a in aa: b = a.replace("年", "-").replace("月", "-").replace("日", " ") # c = '-'.join(b)# print(b) # print(原创 2021-12-29 16:09:33 · 3181 阅读 · 0 评论 -
pycharm开头注释信息
# -*- coding: utf-8 -*-"""@Softwhare:win10 Python 3.6.3 |Anaconda, Inc.| (default, Nov 8 2017, 15:10:56) [MSC v.1900 64 bit (AMD64)] on win32@IDE--Env : ${PRODUCT_NAME}--@Time : ${DATE} ${TIME}@Author : XXXXX--bob@connect : XXXXXX@XXXX.com@Pr原创 2021-04-23 10:33:51 · 366 阅读 · 0 评论 -
代理ip池-scrapy
代理ip池-scrapyfrom scrapy import signalsimport scrapyfrom scrapy.downloadermiddlewares.useragent import UserAgentMiddlewarefrom scrapy.downloadermiddlewares.httpproxy import HttpProxyMiddlewareimport randomclass MyHttpProxyMiddleware(HttpProxyMiddlewa原创 2020-08-04 16:04:14 · 713 阅读 · 0 评论 -
python 字典修改键(key)的方法
dict_new = {}for k,v in dict.items(): print(k,v) dict_new['pre_'+k] = vhttps://blog.csdn.net/a1007720052/article/details/81542134https://blog.csdn.net/a1007720052/article/details/81542134转载 2020-06-17 09:47:34 · 781 阅读 · 0 评论 -
nohup,和& 后台挂起区别和windows下执行linux命令
#!/bin/shcount=`ps -ef |grep diagnostic_analysis.py |grep -v "grep" |wc -l`echo $countif [ 0 == $count ];then # work_path=$(dirname $(readlink -f $0)) # cd ${work_path} # source $VIRTUA...原创 2020-04-15 10:03:00 · 2082 阅读 · 0 评论 -
解决 'chromedriver' executable needs to be in PATH.'报错或Message: 'phantomjs' executable needs to be in
解决 ‘chromedriver’ executable needs to be in PATH.'报错Message: ‘phantomjs’ executable needs to be in PATH.把exe程序拷贝到运行python的根目录下如:原创 2020-04-14 09:43:43 · 363 阅读 · 0 评论 -
datatim python
整合成整点# from datetime import datetimerun_time = (datetime.now()+timedelta(minutes=1)).strftime('%Y-%m-%d %H:%M')# run_time = run_time + ':00'run_time = datetime.strptime(run_time, '%Y-%m-%d %H:%M')...原创 2020-03-01 17:12:08 · 125 阅读 · 0 评论 -
jupyter 更换已有的虚拟环境virtualenv-wap
workon 虚拟环境在虚拟环境里安装ipykernelhttps://blog.csdn.net/lt326030434/article/details/88581790执行jupyter notebook 就可以发现虚拟环境出现了原创 2019-12-23 15:32:39 · 151 阅读 · 0 评论 -
Python程序运行时间、CPU和内存占用的方法_python
的说法就是登陆转载 2019-12-20 20:40:29 · 658 阅读 · 0 评论 -
python列表切分日期,切片与索引效率
测试环境: jupyter py3索引%%timefrom datetime import datetimefor i in range(10000): date_li = ['2019-11-01', '2019-11-15', '2019-11-16', '2019-11-30'] for i in range(0,len(date_li),2): ##...原创 2019-12-19 13:53:39 · 1411 阅读 · 0 评论 -
No module named 'gdbm'The package lists or status file could not be parsed or opened.
No module named 'gdbm’The package lists or status file could not be parsed or opened.在使用apt-get的时候,提示 The package lists or status file could not be parsed or opened. 不能进行正常更新。解决:sudo rm -vf /...转载 2019-11-04 13:51:19 · 192 阅读 · 0 评论 -
python代码规范--个人
虚拟环境 virtualenvwrapper命名: 项目名-env原创 2019-11-04 13:17:38 · 118 阅读 · 0 评论 -
virtualenvwrapper配置报错
修改了python2与python3 默认版本导致找不到重新安装下,就好sudo pip install virtualenvwrapper原创 2019-10-29 10:07:07 · 101 阅读 · 0 评论 -
Python 典藏篇-Microsoft Visual C++ 14.0 is required,官方c++运行库工具一键式解决!
Python 典藏篇-Microsoft Visual C++ 14.0 is required,官方c++运行库工具一键式解决!https://blog.csdn.net/u012914436 原创 Python 典藏篇-Microsoft Visual C++ 14.0 is...转载 2019-10-22 10:34:33 · 384 阅读 · 0 评论 -
Ubuntu16.04下升级Python到3.6.5
http://ubuntuhandbook.org/index.php/2017/07/install-python-3-6-1-in-ubuntu-16-04-lts/https://blog.csdn.net/chaiyu2002/article/details/82698376转载 2019-04-15 21:30:03 · 115 阅读 · 0 评论 -
pip 安装错误 Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory:
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: ‘d:\programdata\anaconda3\lib\site-packages\python_dateutil-2.7.5.dist-info\METADATA’用evetything 搜索METASA文件...原创 2019-04-15 15:47:34 · 1714 阅读 · 1 评论 -
datawhale_爬虫_spider |第八期
文章目录task01任务预览codetask01任务预览1.学习get与post请求,尝试使用requests或者是urllib用get方法向https://www.baidu.com/发出一个请求,并将其返回结果输出。2.如果是断开了网络,再发出申请,结果又是什么。了解申请返回的状态码。3.了解什么是请求头,如何添加请求头。4.学习什么是正则表达式并尝试一些正则表达式并进行匹配。5...原创 2019-08-19 10:59:02 · 1196 阅读 · 0 评论 -
linux python3 安装scrapy 后提示 -bash: scrapy: 未找到命令
linux python3 安装scrapy 后提示 -bash: scrapy: 未找到命令https://blog.csdn.net/dangsh_/article/details/79613210转载 2019-08-27 23:37:01 · 320 阅读 · 0 评论 -
Scrapy爬虫框架---CrawlSpider类
https://www.cnblogs.com/518894-lu/p/9171755.html转载 2019-08-28 22:31:30 · 127 阅读 · 0 评论 -
正确安装python talib库
https://blog.csdn.net/faiy0000/article/details/79924960下载地址https://www.lfd.uci.edu/~gohlke/pythonlibs/cp 为对应python 版本amd64 对应电脑系统位数本人: win10 64位 + python3.6TA_Lib‑0.4.17‑cp36‑cp36m‑win_amd64.wh...原创 2019-03-27 09:33:06 · 1413 阅读 · 0 评论