2016年1月13日

摘要: ----------------基于numpyworld_alcolhol是numpy的array类型。输入:matrix; 输出:matrix# Boolean vector corresponding to Canada and 1986.canada_1986_boolean = (world... 阅读全文
posted @ 2016-01-13 21:58 arsh 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 基于pandas直接相加# Adding up all of the fat columns.# food_info is a dataframe# Adding two columns will go through and add each value at each position to t... 阅读全文
posted @ 2016-01-13 21:57 arsh 阅读(271) 评论(0) 推荐(0) 编辑

2016年1月9日

摘要: python本身方法:f=open("xx.csv","r")b=f.read()rows=b.split('\n')full_data = []for row in rows: cols_in_a_row=row.split(',') full_data.append(cols_in_... 阅读全文
posted @ 2016-01-09 12:56 arsh 阅读(234) 评论(0) 推荐(0) 编辑

2016年1月5日

摘要: ----------------基于普通python#first two elements of list legislators.#[['Bassett', 'Richard', '1745-04-02', 'M', 'sen', 'DE', 'Anti-Administration', '174... 阅读全文
posted @ 2016-01-05 20:35 arsh 阅读(166) 评论(0) 推荐(0) 编辑
摘要: #input is a list named legislators, the first two elements looks like this:#[['Bassett', 'Richard', '1745-04-02', 'M', 'sen', 'DE', 'Anti-Administrati... 阅读全文
posted @ 2016-01-05 20:35 arsh 阅读(168) 评论(0) 推荐(0) 编辑
摘要: #input is a list named legislators, the first two elements looks like this:#[['Bassett', 'Richard', '1745-04-02', 'M', 'sen', 'DE', 'Anti-Administrati... 阅读全文
posted @ 2016-01-05 20:17 arsh 阅读(169) 评论(0) 推荐(0) 编辑
摘要: dataquest上第一个challenge,很简单,但是也可以得到一般的数据处理过程。 这个challenge是从一个csv文件中读入名字和使用的人数,需要得到使用人数大于1000的名字。 1. 读入数据。(open,read) 2. 存储到合适的数据结构中。(split into list... 阅读全文
posted @ 2016-01-05 19:37 arsh 阅读(191) 评论(0) 推荐(0) 编辑

2016年1月3日

摘要: 可汗统计课56 We're trying to test whether a new, low-fat diet actually helps obese people lose weight. 100 randomly assigned obese people are assigned to g 阅读全文
posted @ 2016-01-03 11:57 arsh 阅读(275) 评论(0) 推荐(0) 编辑
摘要: $\vec{a} \cdot \vec{b}=0$ 阅读全文
posted @ 2016-01-03 09:59 arsh 阅读(163) 评论(0) 推荐(0) 编辑

2016年1月2日

摘要: 前几天看王垠的一篇文章谈数学与编程,说数学公式之所以难以理解是因为缺乏统一的形式,而且经常有未定义的变量出现。看这本书时也正有此感,所以有时不必要拘泥公式是否前后一致,理解意思要紧。♣普通最小二乘法ordinary least squares,OLSŶi=β1+β2Xiûi=Yi-Ŷi(加帽表示这是... 阅读全文
posted @ 2016-01-02 21:16 arsh 阅读(285) 评论(0) 推荐(0) 编辑

导航