上一页 1 2 3 4 5 6 7 ··· 16 下一页
摘要: 0 - python 用自带的 wgsi 也可以创建 web 服务1)建立 hello.py 内容如下 # hello.pydef application(environ, start_response): start_response('200 OK', [('Content-Type', 'te 阅读全文
posted @ 2018-03-12 21:18 oftenlin 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 一、安装 virtual env sudo pip install virtualenv二、进入一个空白的目录初始化 virtual env 的环境cd ~/workspace/python/virtualenv test_env# 会自动创建 test_env 文件夹并安装 setuptools 阅读全文
posted @ 2018-03-12 20:56 oftenlin 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 描述:行标签为日期,列标签为时间,表哥的值是 float 的数值# 一、 读取 csv 文件df=pd.read_csv("delay_3.csv",encoding = "utf-8")# 二、 默认读取是行索引是 0 开始计数的,datestr 被作为文本读成了单元格数据,将datestr 转换 阅读全文
posted @ 2018-03-12 20:51 oftenlin 阅读(354) 评论(0) 推荐(0) 编辑
摘要: 一、subline text 常用快捷键1、安装插件:ctrl + shift + p -> packages controll -> 输入插件的名字即可2、python 的脚本的运行 commond + b3、commond + shift + p4、sublime 既可以打开一个文件,也可以打开 阅读全文
posted @ 2018-03-10 23:27 oftenlin 阅读(225) 评论(0) 推荐(0) 编辑
摘要: brew类似ubuntu系统下的apt-get的功能 安装方法: 在Mac中打开Termal: 输入命令: ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" 常用命令: 阅读全文
posted @ 2018-03-05 05:10 oftenlin 阅读(458) 评论(0) 推荐(0) 编辑
摘要: 一、RDD 的创建 1)通过 RDD 的集合数据结构,创建 RDD sc.parallelize(List(1,2,3),2) 其中第二个参数代表的是整个数据,分为 2 个 partition,默认情况会讲数据集进行平分,注意不是两个副本 2)通过文件来读取 sc.textFile("file.tx 阅读全文
posted @ 2018-02-27 13:20 oftenlin 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 1、tuple 的 unpack a,b = t 2、格式化输出 print('您的输入:{},值为{}',format(a,b)) 3、日期计算 import datetime as dt import time as tm print ("time={}",tm.time()) 4、pyhon 阅读全文
posted @ 2018-02-26 10:10 oftenlin 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 一、Spark 为什么比 MapReduce 要高效? 举一个例子: select a.state,count(*),AVERAGE(c.price) from a join b on (a.id=b.id) join c on (a.itemId=c.itermId) group by a.sta 阅读全文
posted @ 2018-02-24 17:36 oftenlin 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 1.DataFrame 按照列和按照行进行索引数据 按照列索引 df[’column_name’] 按照行索引 df.loc[’row_key’] 或 df.iloc[index] 2.先行后列索引单元格数据/先列后行索引单元格数据 df.loc[’row_key’][’column_name’]  阅读全文
posted @ 2018-01-30 16:41 oftenlin 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1、 input 和 raw_input 的区别 raw_input() 直接读取控制台的输入 input() 接收字符时必须加双引号,否则会报错 2、 Python 常见的列表操作 a).相加(相当于连接) >>> [1,2,3]+[4,5,6] [1, 2, 3, 4, 5, 6] b).列表乘 阅读全文
posted @ 2017-11-23 16:52 oftenlin 阅读(558) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 16 下一页