python
Al_shawn
这个作者很懒,什么都没留下…
展开
-
plt seaborn matplotlib x轴坐标倾斜 以及 将说明图表放置在图表外
plt.xticks(rotation=60)plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)原创 2020-11-11 16:24:50 · 8543 阅读 · 0 评论 -
spyder 启动失败
conda install spyder 一下就ojbk原创 2020-01-06 14:19:29 · 793 阅读 · 0 评论 -
python pandas 读取正常,保存本地文件中文乱码
df.to_csv(fpath,index=False,encoding='utf-8-sig')用这个encoding就行原创 2019-12-26 12:24:39 · 295 阅读 · 0 评论 -
pandas读取表格文件过慢
把excel转化成pickle,然后直接读取pickle文件就会很快原创 2019-12-21 15:08:12 · 2501 阅读 · 0 评论 -
python爬虫网页乱码问题ISO-8859-1和Utf-8
爬苹果日报新闻时用requests解析到的网页是乱码用了下面这个就解决了title_content.encode('ISO-8859-1').decode('utf-8')繁体中文可以正常显示了,但是还没搞懂为什么之后记得研究一下参考下面几篇有点略懂但还不是很清晰,之后得好好研究一下编码问题https://www.jianshu.com/p/e487e89c2a4eht...原创 2019-12-19 17:58:11 · 1680 阅读 · 0 评论 -
python调用百度地图api 中文编码错误问题
参考https://www.cnblogs.com/codestack123/p/10798267.htmlurl='http://api.map.baidu.com/place/v2/search?query=银行&location=39.915,116.404&radius=2000&output=xml&ak=您的密钥'url=urllib.parse...原创 2019-10-04 13:42:17 · 375 阅读 · 0 评论 -
selenium ElementNotInteractableException: Element could not be scroll into view
In selenium using python, sometimes there's error:ElementNotInteractableException: Element could not be scroll into viewtoolpath='//*[@id="hdtb-tls"]'toolbutton=driver.find_elements_by_xpat...原创 2019-10-02 15:08:33 · 577 阅读 · 0 评论 -
selenium 爬取数据时设置不弹出浏览器
from selenium.webdriver.firefox.options import Optionsoptions = Options()options.headless = Truedriver = webdriver.Firefox(firefox_options=options, executable_path=ex_path)selenium 使用 firefox ...原创 2019-09-21 15:30:53 · 3892 阅读 · 0 评论 -
jupyter notebook nbextesions 路径(修改snippets)
$(jupyter --data-dir)/nbextensions/snippets/snippets.json在cmd里输入jupyter --data-dir 会返回 nbextensions的路径,然后把上面的(jupyter --data-dir)换成这个路径就可以找到...原创 2019-09-02 14:33:01 · 494 阅读 · 0 评论 -
修改jupyter notebook的默认文件夹
引用自https://www.cnblogs.com/frank1126lin/p/9179945.html这两天在学习使用jupyter notebook,一开始打开的文件夹在个人文档下面,然而我自己编程的程序都放在C盘另一个文件夹下,于是开始找如何修改jupyter的默认文件夹。首先,打开cmd输入jupyter notebook --generate-config 系统会反...转载 2019-04-14 22:23:47 · 415 阅读 · 0 评论 -
StaleElementReferenceException find_element in a for loop python
just clear the string you find in the loop before, then start the find_element function in a new loop原创 2018-09-25 15:13:13 · 210 阅读 · 0 评论