摘要: 主要是箱形图,平均值,中位数,方差的计算及。内容再补。 阅读全文
posted @ 2014-10-27 15:21 林中细雨 阅读(165) 评论(0) 推荐(0) 编辑
摘要: ## Animal is-a object (yes, sort of confusing) look at the extra creditclass Animal(object): pass## ??class Dog(Animal): def __init__(self, name): #... 阅读全文
posted @ 2014-10-27 14:59 林中细雨 阅读(192) 评论(0) 推荐(0) 编辑
摘要: import randomfrom urllib import urlopenimport sysWORD_URL = "http://learncodethehardway.org/words.txt"WORDS = []PHRASES = { "class ###(###):": "Mak... 阅读全文
posted @ 2014-10-27 14:43 林中细雨 阅读(330) 评论(0) 推荐(0) 编辑
摘要: boxplotDefinition : boxplot(x, notch=False, sym='b+', vert=True, whis=1.5, positions=None, widths=None, patch_artist=False, bootstrap=None, usermedian... 阅读全文
posted @ 2014-10-26 17:54 林中细雨 阅读(810) 评论(0) 推荐(0) 编辑
摘要: class Song(object): def __init__(self, lyrics): self.lyrics = lyrics def sing_me_a_song(self): for line in self.lyrics: print linehappy_bda... 阅读全文
posted @ 2014-10-26 11:44 林中细雨 阅读(167) 评论(0) 推荐(0) 编辑
摘要: # create a mapping of state to abbreviationstates = {'Oregon': 'OR','Florida': 'FL','California': 'CA','New York': 'NY','Michigan': 'MI' }# create a b... 阅读全文
posted @ 2014-10-26 11:38 林中细雨 阅读(139) 评论(0) 推荐(0) 编辑
摘要: class Thing(): def test(self, hi): print 'hi'a.test('hello')以上为修改后的代码ten_things = "Apples Oranges Crows Telephone Light Sugar"print "Wait th... 阅读全文
posted @ 2014-10-26 11:08 林中细雨 阅读(144) 评论(0) 推荐(0) 编辑
摘要: anddelfromnotwhileaselifglobalorwithassert #http://stackoverflow.com/questions/5142418/what-is-the-use-of-assert-in-pythonThe assert statement/functio... 阅读全文
posted @ 2014-10-26 10:36 林中细雨 阅读(126) 评论(0) 推荐(0) 编辑
摘要: from sys import exitdef gold_room(): print "This room is full of gold. How much do you take?" next = raw_input("> ") if "0" in next or "1" in... 阅读全文
posted @ 2014-10-25 15:33 林中细雨 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 自己的几个list常用用法。mylist = [i for i in range(10)]mylist.pop(-1)mylist.append(9)mylist_1 = [i for i in range(10,20)]mylist_2 = zip(mylist, mylist_1)mylist.... 阅读全文
posted @ 2014-10-25 11:21 林中细雨 阅读(178) 评论(0) 推荐(0) 编辑