|
From: Mark H. <ma...@mi...> - 2006-01-20 04:37:35
|
Sasha wrote: >Try a.fill(7). > >On my system: > > >>python -m timeit -s "import numpy as na; a = na.zeros((1000,1000))" "a[:,:] = 7" >> >> >100 loops, best of 3: 17.1 msec per loop > > > >>python -m timeit -s "import numpy as na; a = na.zeros((1000,1000))" "a.fill(7)" >> >> >100 loops, best of 3: 6.28 msec per loop > >You can also use empty instead of zeros, but that wont affect the >timings that you presented. > >-- sasha > > > Thank you. Any equivalent to 'fill' for NumArray or Numeric? Well, I suppose its time to move to Sci/NumPy. Im on Fedora 4, any pointers to a NumPy package? Mean time Ill pull from SVN and try again to build. I have the updated gcc Fortran. Mark |