上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 29 下一页
摘要: sklearn 是 python 下的机器学习库。scikit-learn的目的是作为一个“黑盒”来工作,即使用户不了解实现也能产生很好的结果。其功能非常强大,当然也有很多不足的地方,就比如说神经网络就只有一个RBM(不是人民币哈)。但是,不管怎样,首荐!!这个例子比较了几种分类器的效果,并直观的显... 阅读全文
posted @ 2016-01-11 04:39 罗兵 阅读(7778) 评论(0) 推荐(1) 编辑
摘要: matplotlib有一个finance子模块提供了一个获取雅虎股票数据的api接口:quotes_historical_yahoo_ochl感觉非常好用!示例一 获取数据并作折线图import matplotlib.pyplot as pltfrom matplotlib.finance impo... 阅读全文
posted @ 2016-01-11 03:52 罗兵 阅读(15515) 评论(5) 推荐(0) 编辑
摘要: 以下代码在 python 3.5 + jupyter notebook 中运行测试无误!# 我们爬取网页的目的,无非是先定位到DOM树的节点,然后取其文本或属性值myPage = ''' TITLE 我的博客 我的文章 ... 阅读全文
posted @ 2015-12-27 07:16 罗兵 阅读(39193) 评论(0) 推荐(7) 编辑
摘要: 【原文地址:】http://python.jobbole.com/83588/import requestsfrom lxml import html# 创建 session 对象。这个对象会保存所有的登录会话请求。session_requests = requests.session()# 提取在... 阅读全文
posted @ 2015-12-22 18:08 罗兵 阅读(11117) 评论(0) 推荐(1) 编辑
摘要: 一、多线程import threadingfrom time import ctime,sleepdef music(func): for i in range(2): print("I was listening to %s. %s" %(func,ctime())) ... 阅读全文
posted @ 2015-12-17 03:27 罗兵 阅读(624) 评论(1) 推荐(0) 编辑
摘要: '''得到当前页面所有连接'''import requestsimport refrom bs4 import BeautifulSoupfrom lxml import etreefrom selenium import webdriverurl = 'http://www.ok226.com'r... 阅读全文
posted @ 2015-12-14 03:15 罗兵 阅读(12192) 评论(4) 推荐(3) 编辑
摘要: 转载说明:原文地址:http://my.oschina.net/alazyer/blog/223354原文有十处左右的错误,修正后转载于此。经验证,python 3.4.3下可用。请各位朋友明察。使用Python操作Excel不是什么难事,需要用到两个Lib, python-xlrd,python-... 阅读全文
posted @ 2015-11-16 19:43 罗兵 阅读(813) 评论(0) 推荐(0) 编辑
摘要: from lxml import etree#####################基本用法:#####################html = '''登录 用户: 密码: '''# 生成DOMdom = etree.HTML(html)# 取内容 /text()conte... 阅读全文
posted @ 2015-06-17 13:59 罗兵 阅读(1466) 评论(0) 推荐(0) 编辑
摘要: 我的环境是windows7 + python34 + django1.8下面两篇文章提到了django的scaffold,感觉是一个挺不错的功能:Django实战(3):Django也可以有scaffoldDjango1.5+Python3.3下groundwork的使用于是去Github下载了dj... 阅读全文
posted @ 2015-06-09 18:01 罗兵 阅读(1604) 评论(6) 推荐(2) 编辑
摘要: 【转载说明:原文排版不是很好,为方便阅读,改进了排版】django的表单设计真的很棒,涉及非常多的功能,今天介绍django较为主流的几种表单使用方法。注:本文中表单与form通用、模型与model通用。表单、模型的基础知识可以通过django book学习。传送门:http://djangoboo... 阅读全文
posted @ 2015-05-24 22:07 罗兵 阅读(594) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 29 下一页