[Numpy-tickets] [NumPy] #555: setting random seed does not work with a numpy.int64

NumPy numpy-tickets@scipy....
Tue Jul 24 09:02:31 CDT 2007


#555: setting random seed does not work with a numpy.int64
--------------------------+-------------------------------------------------
 Reporter:  scottzelak    |       Owner:  somebody   
     Type:  defect        |      Status:  new        
 Priority:  normal        |   Milestone:             
Component:  numpy.random  |     Version:  1.0.2      
 Severity:  normal        |    Keywords:  seed random
--------------------------+-------------------------------------------------
 The following code fails:

 {{{
 for loop_num in arange(4):
     random.seed(loop_num)

 Traceback (most recent call last):
   File "<stdin>", line 2, in <module>
   File "mtrand.pyx", line 515, in mtrand.RandomState.seed
 ValueError: object of too small depth for desired array
 }}}

 but will work if I replace the command in the loop with:[[BR]]
 {{{
     random.seed(int(loop_num))
 }}}

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/555>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list