摘要: import matplotlib.pyplot as plt def fib(n): if n == 1 or n== 2: return 1 else: return fib(n-1) + fib(n-2) for i in range(1, 6): print(fib(i)) 阅读全文
posted @ 2018-11-19 07:13 WWBlog 阅读(358) 评论(0) 推荐(0) 编辑
摘要: empirical cumulative distribution function(ECDF) 经验累积分布函数 阅读全文
posted @ 2018-10-30 22:43 WWBlog 阅读(2269) 评论(0) 推荐(0) 编辑
摘要: SeanCheney 翻译的中文版, 也有英文资源,分享给大家学习。 https://www.jianshu.com/p/04d180d90a3f 阅读全文
posted @ 2018-10-01 10:58 WWBlog 阅读(1500) 评论(0) 推荐(0) 编辑
摘要: 1 def _odd_iter(): 2 n = 1 3 while True: 4 n = n+2 5 yield n 6 7 def _not_divisible(n) : 8 return lambda x: x % n >0 9 10 def primes(): 11 yield 2... 阅读全文
posted @ 2018-03-24 17:41 WWBlog 阅读(154) 评论(0) 推荐(0) 编辑
摘要: import sys #和python解释器交互 sys.argv #返回文件名、参数 sys.exit() #退出程序,正常退出sys.exit(0) sys.version #获取Python解释程序的版本信息 sys.path #返回模块的搜索路径,初始化时使用PYTHONPATH变量的值 s 阅读全文
posted @ 2018-03-12 23:08 WWBlog 阅读(71) 评论(0) 推荐(0) 编辑
摘要: import os#help(os) os.getcwd() #获取当前工作目录 os.chdir("dirname") #改变当前工作目录 os.curdir #返回当前目录 '..' os.pardir#返回当前目录的父目录 '..' os.makedirs("dirname1/dirname2 阅读全文
posted @ 2018-03-12 22:48 WWBlog 阅读(109) 评论(0) 推荐(0) 编辑
摘要: import random def v_code(n):#随机生成包含数字、大小写字母的验证码 code ='' for i in range(n): add = random.choice([random.randrange(10), chr(random.randrange(65, 91)), ... 阅读全文
posted @ 2018-03-10 13:46 WWBlog 阅读(113) 评论(0) 推荐(0) 编辑