我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用pylab.randn()。
def test_running_median(): x = randn(100) rm1 = RunningMedian(x,7).run() rm2= scipy.signal.medfilt(x, 7) diff = sum((rm2-rm1)[3:-3]) # get rid of the first and last W/2 points, where W=7 assert abs(diff)<=1e-10 # non-even list try: rm1 = RunningMedian(x,10).run() assert True except: assert True
def test(): from pylab import randn sumouter(randn(11,3),randn(11,4),out=randn(3,4)) sumprod(randn(11,7),randn(11,7),out=randn(7))