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

Matthew Brett matthew.brett@gmail....
Sun Jun 13 10:21:50 CDT 2010


Hi,

I'm not getting the deviation on my laptop:

[mb312@blair-2 ~]$ uname -a
Darwin blair-2.local 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26
11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386
[mb312@blair-2 ~]$ python --version
Python 2.6.4

> 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 ])

In [2]: import numpy as np

In [3]: np.random.seed(0)

In [4]: np.random.randn(3)
Out[4]: array([ 1.76405235,  0.40015721,  0.97873798])

In [5]: np.__version__
Out[5]: '2.0.0.dev8445'

I compiled python myself.

Nor to I get it with EPD 6.1 and numpy 1.4.0:

[mb312@blair-2 ~]$ /Library/Frameworks/Python.framework/Versions/6.1/bin/python
Enthought Python Distribution -- http://www.enthought.com
Version: 6.1-1 (32-bit)

Python 2.6.4 |EPD 6.1-1 (32-bit)| (r264:75706, Dec 11 2009, 10:58:54)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.__version__
'1.4.0'
>>> np.random.seed(0)
>>> np.random.randn(3)
array([ 1.76405235,  0.40015721,  0.97873798])
>>>

I wonder if there is something strange about your build?

Best,

Matthew


More information about the SciPy-Dev mailing list