[Numpy-discussion] Problem with randn

Keith Goodman kwgoodman at gmail.com
Tue Aug 29 11:43:34 EDT 2006


randn incorrectly returns random numbers only between 0 and 1 in numpy
1.0b1. random.randn works.

>> from numpy.matlib import *

>> randn(3,4)

matrix([[ 0.60856413,  0.35500732,  0.48089868,  0.7044022 ],
        [ 0.71098538,  0.8506885 ,  0.56154652,  0.4243273 ],
        [ 0.89655777,  0.92339559,  0.62247685,  0.70340003]])

>> randn(3,4)

matrix([[ 0.84349201,  0.55638171,  0.19052097,  0.0927636 ],
        [ 0.60144183,  0.3788309 ,  0.41451568,  0.61766302],
        [ 0.98992704,  0.94276652,  0.18569066,  0.69976656]])

>> randn(3,4)

matrix([[ 0.69003273,  0.07171546,  0.34549767,  0.20901683],
        [ 0.1333439 ,  0.4086678 ,  0.80960253,  0.86864547],
        [ 0.75329427,  0.6760677 ,  0.32496542,  0.99402779]])

>> random.randn(3,4)

array([[ 1.00107604,  0.41418557, -0.07923699,  0.19203247],
       [-0.29386593,  0.02343702, -0.42366834, -1.27978993],
       [ 0.25722357, -0.53765827,  0.50569238, -2.44592854]])




More information about the NumPy-Discussion mailing list