摘要: NumPy has the same functionality as Matlab in terms of arrays (maybe a little more) but there are some syntax differences in creating and indexing arrays that confused me at first when switching from Matlab to NumPy.There is amore comprehensive tutorialon NumPy, here I’m just trying to work out some 阅读全文
posted @ 2013-06-08 18:25 IT屁民 阅读(1191) 评论(0) 推荐(0) 编辑
摘要: 刚学用Python的时候,特别是看一些库的源码时,经常会看到func(*args, **kwargs)这样的函数定义,这个*和**让人有点费解。其实只要把函数参数定义搞清楚了,就不难理解了。先说说函数定义,我们都知道,下面的代码定义了一个函数funcAdef funcA(): pass显然,函数funcA没有参数(同时啥也不干:D)。下面这个函数funcB就有两个参数了,def funcB(a, b): print a print b调用的时候,我们需要使用函数名,加上圆括号扩起来的参数列表,比如 funcB(100, 99),执行结果是:10099很明显,参数的顺序和个数要和函数定义中一致, 阅读全文
posted @ 2013-06-08 18:21 IT屁民 阅读(351) 评论(0) 推荐(0) 编辑
摘要: One of the questions an instrutor dreads most from a mathematically unsophisticated audience is, "What exactly is degrees of freedom?" It's not that there's no answer. The mathematical answer is a single phrase, "The rank of a quadratic form." The problem is translating t 阅读全文
posted @ 2013-06-08 18:20 IT屁民 阅读(1232) 评论(0) 推荐(0) 编辑