
programming.python
sylmoon
这个作者很懒,什么都没留下…
展开
-
python first lesson
Python 3.6.3 (v3.6.3:2c5fed8, Oct 3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)] on win32Type "copyright", "credits" or "license()" for more information.>>> print ("hello world")hello world>>>原创 2017-11-28 22:36:54 · 799 阅读 · 0 评论 -
seaborn 画图功能简单总结
seaborn 画图功能原创 2018-01-04 18:43:03 · 12326 阅读 · 0 评论 -
python 画散点图
用matplotlib画分类散点图import pandas as pdimport seaborn as sb import matplotlib .pyplot as plt%matplotlib inline iris=pd.read_csv("g:/tools/python/iris.data.csv")iris.sample(10)g=sb.FacetGrid(iris, hue="Sp原创 2018-01-02 15:34:02 · 1280 阅读 · 0 评论 -
ImportError: No module named 'bs4'
ImportError Traceback (most recent call last) in ()----> 1 from bs4 import BeautifulSoupImportError: No module named 'bs4'解决思路 :1. pip list 查看结果BS4, beautifulSoup原创 2017-12-15 17:34:08 · 3839 阅读 · 5 评论 -
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
JSONDecodeError Traceback (most recent call last) in () 11 url_visit='http://kuaidi100.com/query?type=shentong&postid={}'.format(postid) 12 crawl_content=urlreques原创 2017-12-15 14:19:56 · 16163 阅读 · 2 评论 -
获取豆瓣电影评分并保存到本地 遇到3个错误
1.IndentationError:expected an indented blocksolution :python 非常注意缩进 2.python-TypeError: write() argument must be str, not floatstr(float)3.TypeError: write() takes exactly one原创 2017-12-13 11:23:03 · 909 阅读 · 0 评论 -
python 操作json
import jsonjson_content = '{"name":"test", "type":{"name":"seq", "parameter":["1", "2"]}}'print u"JSON到字典转化(方法一):"l = eval(json_content)print lprint l.keys()print l["name"]print l["type"]["na转载 2017-12-12 12:02:15 · 382 阅读 · 0 评论 -
豆瓣 URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:719)>
import urllib.request as urlrequest #import ssl#ssl._create_default_https_context = ssl._create_unverified_contexturl_visit='https://api.douban.com/v2/movie/subject/1764796'crawl_content=urlre转载 2017-12-11 22:57:58 · 8374 阅读 · 1 评论 -
pycham import random
https://zhidao.baidu.com/question/813163385554993052.htmlpython3在pycharm中为什么导入random模块不能用? TypeError: 'module' object is not callable新手学python求大神指导,也用sys导入了random.py的路径,仍然不行。刚刚排错貌似找到了问题的转载 2017-11-30 18:47:30 · 3909 阅读 · 1 评论 -
python 格式对齐很重要!!!
while b 10: print("fibonacci is ", b) a, b = b, a + b和while b 10: print("fibonacci is ", b) a, b = b, a + b第一段代码可以正确打印出斐波那契数列, 而第二段代码因为没有对齐, b=1会 不停地被打印变量严格区分大小写原创 2017-11-30 17:58:28 · 9096 阅读 · 1 评论 -
python 写斐波那契数列, 复合赋值很特别
a = 0b = 1c = 1while c 10: print("fibonacci is", c) c = a + b a = b b = c print("a is", a) print("b is", b)'''a = 0 b = 1 while b < 10: print("fibonacci原创 2017-11-30 17:44:18 · 664 阅读 · 0 评论