[SciPy-Dev] seeded randn gets different values on osx
Sun Jun 13 16:20:16 CDT 2010
On Sun, Jun 13, 2010 at 12:17, Vincent Davis <firstname.lastname@example.org> wrote:
> On Sun, Jun 13, 2010 at 9:46 AM, Matthew Brett <email@example.com> wrote:
>> >> 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 : import numpy as np
>> In : np.__version__
>> Out: '1.4.0'
>> In : np.random.seed(0)
>> In : np.random.randn(3)
>> Out: 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.
It was an intentional, but poorly thought out change. Ilan Schnell
implemented a fast ziggurat algorithm for generating normal variates.
I think we will be reverting this modification for the stock numpy in
EPD (but don't quote me on that).
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the SciPy-Dev