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

Charles R Harris charlesr.harris at gmail.com
Sat Jun 12 22:09:30 EDT 2010


On Sat, Jun 12, 2010 at 7:44 PM, Vincent Davis <vincent at vincentdavis.net>wrote:

> There was another tread (scipy 8.0b release) describing a problem with
> FAIL: test_stats.test_kstest see full test fail below.
>
> After a little discusion with Josef here are some results. It appears
> to me that osx gets different values from a seeded randn
>
> >From Josef, I assume windows
> >>>>> np.random.seed(0)
> >>>>> np.random.randn(3)
> >> array([ 1.76405235,  0.40015721,  0.97873798])
> >
> 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 ])
>
> ubuntu 10.0.4  py 2.5.6 current scipy and numpy just built from the git
> source.
> >>> np.random.seed(0)
> >>> np.random.randn(3)
> array([ 1.76405235,  0.40015721,  0.97873798])
>
> FAIL: test_stats.test_kstest
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File
> "/Library/Frameworks/EPD64.framework/Versions/6.2/lib/python2.6/site-packages/nose/case.py",
> line 186, in runTest
>   self.test(*self.arg)
>  File
> "/Library/Frameworks/EPD64.framework/Versions/6.2/lib/python2.6/site-packages/scipy/stats/tests/test_stats.py",
> line 1228, in test_kstest
>   assert_almost_equal( D, 0.12464329735846891, 15)
>  File
> "/Library/Frameworks/EPD64.framework/Versions/6.2/lib/python2.6/site-packages/numpy/testing/utils.py",
> line 459, in assert_almost_equal
>   raise AssertionError(msg)
> AssertionError:
> Arrays are not almost equal
>  ACTUAL: 0.093893737596468518
>  DESIRED: 0.12464329735846891
> ______


There were some changes to the random normal generator in trunk, but I don't
think they should affect this. What versions of numpy is everyone using?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20100612/e5655db6/attachment.html>


More information about the SciPy-Dev mailing list