摘要:墙内访问youtube没有特别好的方法,只找到一个,提供格式转换和下载:http://new.cloudfile.co/transfer1. 修改host文件,照常用网页访问。有人会提供最新host文件:http://blog.my-eclipse.cn/host-google.html2. 网页可...
阅读全文
摘要:基于pandas求和。column_list = ['Fiber_TD_(g)', 'Sugar_Tot_(g)']# Let's sum up the total amount of fiber and sugar across all the foods.total = food_info[co...
阅读全文
摘要:基于pandasall_columns = list(food_info.columns.values)#the first two columns don't need to be normalizedall_columns = all_columns[2:len(all_columns)]for...
阅读全文
摘要:基于pandasascending_fat_then_ascending_sodium = food_info.sort(["Lipid_Tot_(g)", "Sodium_(mg)"], ascending=[True, True])#get the first three food top_th...
阅读全文
摘要:----------------基于numpyworld_alcolhol是numpy的array类型。输入:matrix; 输出:matrix# Boolean vector corresponding to Canada and 1986.canada_1986_boolean = (world...
阅读全文
摘要:基于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...
阅读全文
摘要: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_...
阅读全文
摘要:#input is a list named legislators, the first two elements looks like this:#[['Bassett', 'Richard', '1745-04-02', 'M', 'sen', 'DE', 'Anti-Administrati...
阅读全文
摘要:----------------基于普通python#first two elements of list legislators.#[['Bassett', 'Richard', '1745-04-02', 'M', 'sen', 'DE', 'Anti-Administration', '174...
阅读全文
摘要:#input is a list named legislators, the first two elements looks like this:#[['Bassett', 'Richard', '1745-04-02', 'M', 'sen', 'DE', 'Anti-Administrati...
阅读全文
摘要:dataquest上第一个challenge,很简单,但是也可以得到一般的数据处理过程。 这个challenge是从一个csv文件中读入名字和使用的人数,需要得到使用人数大于1000的名字。 1. 读入数据。(open,read)
2. 存储到合适的数据结构中。(split into list...
阅读全文
摘要:可汗统计课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
阅读全文
摘要:$\vec{a} \cdot \vec{b}=0$
阅读全文
摘要:前几天看王垠的一篇文章谈数学与编程,说数学公式之所以难以理解是因为缺乏统一的形式,而且经常有未定义的变量出现。看这本书时也正有此感,所以有时不必要拘泥公式是否前后一致,理解意思要紧。♣普通最小二乘法ordinary least squares,OLSŶi=β1+β2Xiûi=Yi-Ŷi(加帽表示这是...
阅读全文