[SciPy-Dev] seeded randn gets different values on osx

Vincent Davis vincent at vincentdavis.net
Sun Jun 13 13:17:24 EDT 2010


On Sun, Jun 13, 2010 at 9:46 AM, Matthew Brett <matthew.brett at gmail.com>wrote:

> Hi,
>
> >> After a little discusion with Josef here are some results. It appears
> >> to me that osx gets different values from a seeded randn
> >
> >> On my machine OSX py 2.6.5, numpy 1.4.0 scipy 8.0b
> >>>>>> np.random.seed(0)
> >>>>>> np.random.randn(3)
> >>> array([ 0.06897149,  1.32078057,  1.5997924 ])
>
> Nor in a numpy-1.4.0 virtualenv:
>
> In [1]: import numpy as np
>
> In [2]: np.__version__
> Out[2]: '1.4.0'
>
> In [3]: np.random.seed(0)
>
> In [4]: np.random.randn(3)
> Out[4]: array([ 1.76405235,  0.40015721,  0.97873798])
>

I just built 2.6 from current daily snapshot and installed numpy. Now I get
the right answer

MacBookPro-new-2:~ vmd$ py26
Python 2.6.5+ (release26-maint, Jun 13 2010, 10:02:04)
[GCC 4.2.1 (Apple Inc. build 5659)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import numpy as np
>>> np.random.seed(0)
>>> np.random.randn(3)
array([ 1.76405235,  0.40015721,  0.97873798])

So I guess there is something wrong with the enthought 6.2 dist.

Should there be a test added for this type of error?

Thanks
Vincent


> Best,
>
> Matthew
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>

  *Vincent Davis
720-301-3003 *
vincent at vincentdavis.net
 my blog <http://vincentdavis.net> |
LinkedIn<http://www.linkedin.com/in/vincentdavis>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20100613/5cb261e6/attachment.html>


More information about the SciPy-Dev mailing list