python
m3317053
这个作者很懒,什么都没留下…
展开
-
python time
import time 三种结构:时间戳,字符串,struct_timetime.time() 当下时间戳time.local(时间戳) 时间戳 -> 当地时区的struct_timetime.strptime(‘2018-10-07’, ‘%Y-%m-%d’) 字符串 -> strcut_timetime.strftime(’%Y-%m-%d’, struct_time) s...原创 2018-10-07 15:42:01 · 148 阅读 · 0 评论 -
lxml笔记
from lxml import etreehtml_tree = etree.HTML(html string)html_tree.xpath(’’) 参考:http://www.w3school.com.cn/xpath/xpath_syntax.asp#xpath 和css selector基本可以互换css selector 参考:http://www.w3school.com.c...原创 2018-10-15 04:21:24 · 122 阅读 · 0 评论 -
mongo笔记
**pymongo**:import pymongomyclient = pymongo.MongoClient(‘mongodb://localhost:27017/’)mycollection = myclient[‘Xiaohua’][‘second’]#find 返回的都是cursor类似生成器mycollection.find().count()#计数mycollecti...原创 2018-10-15 04:26:05 · 125 阅读 · 0 评论 -
绘图
pandas to excel填充颜色excel = dataframe.style.background_gradient(cmap=‘RdBu’,low=0.5,high=0.5,axis=0)excel.to_excel(name+’.xlsx’)样式cmap:https://matplotlib.org/examples/color/colormaps_reference.html...原创 2018-12-31 01:35:39 · 103 阅读 · 0 评论