上一页 1 ··· 5 6 7 8 9 10 下一页
摘要: http://blog.csdn.net/zouxy09/article/details/8775518 阅读全文
posted @ 2014-11-16 11:44 cdsj 阅读(97) 评论(0) 推荐(0) 编辑
摘要: http://docs.python-guide.org/en/latest/scenarios/scrape/ 阅读全文
posted @ 2014-11-15 19:35 cdsj 阅读(190) 评论(0) 推荐(0) 编辑
摘要: http://blog.sina.com.cn/s/blog_5e16f1770100gyxn.html 阅读全文
posted @ 2014-11-07 23:55 cdsj 阅读(652) 评论(0) 推荐(0) 编辑
摘要: 前提是先安装python2.7,设置环境变量。1.pip install pyzmq2.pip install jinja23.pip install tornado4.pip install ipython最后运行ipython notebook 阅读全文
posted @ 2014-11-04 13:29 cdsj 阅读(227) 评论(0) 推荐(0) 编辑
摘要: ipython nbconvert notebookname.ipynb --to latex --post pdf 阅读全文
posted @ 2014-09-12 10:53 cdsj 阅读(817) 评论(0) 推荐(0) 编辑
摘要: 转自:http://bbs.chinaunix.net/thread-1689276-1-1.htmlfilter(str.isdigit, '123ab45') 阅读全文
posted @ 2014-08-03 13:32 cdsj 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 打开https://pip.pypa.io/en/latest/installing.html#python-os-support下载pip-get.py进入python,执行pip-get.py安装完pip。或者安装,setuptool工具。进入.python/scripts目录,执行setup_... 阅读全文
posted @ 2014-07-27 00:49 cdsj 阅读(355) 评论(0) 推荐(0) 编辑
摘要: http://blog.chinaunix.net/uid-26722078-id-3484197.html1.列表推导看几个例子,一切就明白了。 1 #!/usr/bin/python 2 numbers = range(10) 3 size = len(numbers) 4 evens = [] 5 i = 0 6 while i < size: 7 if i%2 == 0: 8 evens.append(i) 9 i += 110 print evens11 12 #!/usr/bin/python13 evens = [i for i in range... 阅读全文
posted @ 2014-02-17 10:42 cdsj 阅读(185) 评论(0) 推荐(0) 编辑
摘要: http://eagletff.blog.163.com/blog/static/116350928201266111125832/一般情况下,如果要对一个列表或者数组既要遍历索引又要遍历元素时,可以用enumerate比如:for index,value in enumerate(list):print index,value当然也可以for i in range(0,len(list)):print i,list[i]相比较而言,前者更简练另外一种使用情况,当要计算文件的行数的时候,可以这样写:lineNum = len(open(fileName,'r').readlin 阅读全文
posted @ 2014-02-17 10:38 cdsj 阅读(2549) 评论(0) 推荐(1) 编辑
摘要: 1 >>> help(set) 2 Help on class set in module __builtin__: 3 4 class set(object) 5 | set(iterable) --> set object 6 | 7 | Build an unordered collection of unique elements.#无序、独一无二的元素 8 | 9 | Methods defined here: 10 | 11 | __and__(...) 12 | x.__and__(y) x&y 13 | 14 | ... 阅读全文
posted @ 2014-02-06 00:03 cdsj 阅读(238) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 下一页