![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python编程
文章平均质量分 50
sniper24
略懂Python,略懂Data Mining,大数据分析新兵
展开
-
Python 标准模块 ConfigParser(转)
发现python读写配置文件比较方便。import ConfigParser接口:ConfigParser.ConfigParser()读写文件:read write结构: config file =>sections=>options=>items读取某个option的值(str): get(section,option)1) 基本的读取配置文转载 2015-11-09 10:41:01 · 239 阅读 · 0 评论 -
pyspark笔记
pyspark.sql.SQLContextTop funcs: 1. 创建DF createDataFrame(data,schema) 2. 从多种数据源读取数据,sqlContext 3. user-define类 registerDataFrameAsTable(df, tableName) registerFunction(name, f, returnType=StringT原创 2015-10-26 11:36:06 · 1130 阅读 · 0 评论 -
廖雪峰教程笔记补遗
1. 关于中文字符串(最后一次)#coding: utf-8 显示,写入文件均正常2. 高阶函数sorted() (升序)sorted()可以传入一个函数通常规定,对于两个元素x和y,如果认为x ,则返回-1,如果认为x == y,则返回0,如果认为x > y,则返回1,这样,排序算法就不用关心具体的比较过程,而是根据比较结果直接排序。转载 2016-02-17 18:02:41 · 450 阅读 · 0 评论 -
Python装饰器学习(九步入门)
转载自http://www.cnblogs.com/rhcad/archive/2011/12/21/2295507.html这是在Python学习小组上介绍的内容,现学现卖、多练习是好的学习方式。第一步:最简单的函数,准备附加额外功能12345678#转载 2016-02-05 11:31:22 · 412 阅读 · 0 评论 -
Scrapy爬虫框架笔记
1. 启动Scrapy爬虫除了常用的 scrapy crawl 来启动Scrapy,您也可以使用 API 在脚本中启动Scrapy。2. XPath 定位 Firebug(Firefox插件)可以使用Chrome的XPath helperfirefox上的若干插件3. 关于登陆爬取http://outofmemory.cn/code-snippet/1原创 2016-02-04 09:46:42 · 344 阅读 · 0 评论 -
python regex 入门笔记
可以参考这篇博文: http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.htmlimport re正则表达式,我的理解就是匹配文本中的pattern,那么这个过程可以分解为两个部分: A. 定义自己需要的pattern B. 用自己定义好的pattern在目标文本中进行匹配,然后对匹配到的对象进行操作确定一个pattern,最主要的两个原创 2015-10-24 21:48:15 · 330 阅读 · 0 评论 -
NumPy 笔记[0]
回到NumPy的话题,开始分析来自这个地址的数据集。df=np.genfromtxt(filename,skip_header=1,delimiter=",",converters=None,names=True)然后就出问题了,ValueError: Some errors were detected ! Line #146 (got 18 columns instead of 17)这可原创 2015-10-25 00:46:00 · 426 阅读 · 0 评论 -
Scrapy爬虫笔记-未完成
启动Scrapy爬虫 除了常用的 scrapy crawl 来启动Scrapy,您也可以使用 API 在脚本中启动Scrapy。XPath 定位 Firebug(Firefox插件) 可以使用Chrome的XPath helper firefox上的若干插件关于登陆爬取 http://outofmemory.cn/code-snippet/16528/scrapy-again-to-原创 2016-02-01 11:01:50 · 580 阅读 · 0 评论 -
openpyxl笔记 重制版
参考资料:# 官方文档http://packages.python.org/openpyxl/api.html# openpyxl 读写excel2007使用笔记http://blog.csdn.net/hxsyewlink/article/details/6265790注意,截止2016-02-01 openpyxl仍不支持读取表格和图像,所以如果打开又以同样的名称保存原创 2016-02-04 09:47:22 · 1822 阅读 · 0 评论