- 博客(6)
- 收藏
- 关注
原创 Hypothesis Testing
We first set up a null hypothesis that describes the status,then state an alternative hypothesis. In the end, we either need to: reject the null hypothesis and accept the alternative hypoth
2016-03-30 19:49:47 958
原创 Python——Requests
requests.get——向一个网页请求数据的模块# 向国际空间站网页服务器发出一个数据请求,并获取请求的状态码import requestsresponse = requests.get("http://api.open-notify.org/iss-now.json")status_code = response.status_codeoutput:200状态码分为:200 – ev
2016-03-30 16:36:00 636
原创 Python——Pandas
panda.read_csv()import pandasfood_info = pandas.read_csv("food_info.csv")print(type(food_info)output:<class 'pandas.core.frame.DataFrame'>read_csv()返回的是一个DataFrame对象。food_info.csv是一个food营养成分表格,每一行
2016-03-30 11:05:59 3071
原创 Python——import
以下情况都是a.py调用b.py:——a.py——b.py 直接是import b——f1 ——a.py——b.py 直接是import b——a.py——f2 ——b.py 需要在f2文件夹中建立空文件_init_.py文件,然后import f2.b——f1 ——a.py——f2 ——b.py 当a 和b的父文夹同级,需要现在f2下建立_init_.py的空文件,然后在
2016-03-28 09:43:29 432
原创 Python——sorted
1.对字典进行排序:d = {0: [2, 3], 1: [5, 4], 2: [9, 6], 3: [4, 7], 4: [8, 1], 5: [7, 2]}1.1按键排序print sorted(d.items(), lambda x, y: cmp(x[1][0], y[1][0]))结果:[(0, [2, 3]), (3, [4, 7]), (1, [5, 4]), (5, [7, 2])
2016-03-26 11:13:14 617
原创 Python——sys.argv
关于python中sys模块的参数argv:# -*- coding: utf-8 -*-# function name : sys.argv.pyimport sysprint 'This is a sys test'for i in sys.argv: print i在cmd中运行改程序,并且自己输入一些参数: 可以发现,argv[0]是函数的名称,而后面几个参数是自己手动
2016-03-26 08:57:45 682
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人