Re: [Numpy-discussion] numpy from subversion

2008-03-13 Thread Stéfan van der Walt
On Wed, Mar 12, 2008 at 11:39 AM, Charles Doutriaux <[EMAIL PROTECTED]> wrote: > My mistake i was still in trunk > > but i do get: > > import numpy, numpy.oldnumeric.ma as MA, numpy.oldnumeric as > Numeric, PropertiedClasses > File > "/lgm/cdat/latest/lib/python2.5/site-packages/numpy/

Re: [Numpy-discussion] Help needed with numpy 10.5 release blockers

2008-03-13 Thread Jarrod Millman
On Wed, Mar 12, 2008 at 10:43 PM, Jarrod Millman <[EMAIL PROTECTED]> wrote: > Stefan and I also triaged the remaining tickets--closing several and > turning others in to release blockers: > > http://scipy.org/scipy/numpy/query?status=new&severity=blocker&milestone=1.0.5&order=priority > > I th

[Numpy-discussion] Transforming an array of numbers to an array of formatted strings

2008-03-13 Thread Alexander Michael
Is there a better way than looping to perform the following transformation? >>> import numpy >>> int_data = numpy.arange(1,11, dtype=int) # just an example >>> str_data = int_data.astype('S4') >>> for i in xrange(len(int_data)): ... str_data[i] = 'S%03d' % int_data[i] >>> print str_data ['S00

Re: [Numpy-discussion] Transforming an array of numbers to an array of formatted strings

2008-03-13 Thread Alan G Isaac
On Thu, 13 Mar 2008, Alexander Michael apparently wrote: > I want to format an array of numbers as strings. To what end? Note that tofile has a format option. And for 1d array ``x`` you can always do:: strdata = list( fmt%xi for xi in x) Nice because the counter name does not "bleed" into y

Re: [Numpy-discussion] numpy from subversion

2008-03-13 Thread Charles Doutriaux
Hi Stephan, Does the converter from Numeric fixes that? I mean runnning it on an old Numeric script will import numpy.ma, does it still replace with numpy.oldnumeric.ma? Thx, C. Stéfan van der Walt wrote: > On Wed, Mar 12, 2008 at 11:39 AM, Charles Doutriaux <[EMAIL PROTECTED]> wrote: > >>

[Numpy-discussion] numpy.array.ma class init

2008-03-13 Thread Charles Doutriaux
Hello, we used to have this working, the latest numpy breaks it. File "/lgm/cdat/5.0.0.alpha7/lib/python2.5/site-packages/cdms2/tvariable.py", line 21, in import numpy.oldnumeric.ma as MA class TransientVariable(AbstractVariable, MA.array): TypeError: Error when calling the metaclass bases

Re: [Numpy-discussion] Transforming an array of numbers to an array of formatted strings

2008-03-13 Thread David Huard
['S%03d'%i for i in int_data] David 2008/3/13, Alan G Isaac <[EMAIL PROTECTED]>: > > On Thu, 13 Mar 2008, Alexander Michael apparently wrote: > > I want to format an array of numbers as strings. > > > To what end? > Note that tofile has a format option. > And for 1d array ``x`` you can always do

Re: [Numpy-discussion] Transforming an array of numbers to an array of formatted strings

2008-03-13 Thread Alan G Isaac
> 2008/3/13, Alan G Isaac <[EMAIL PROTECTED]>: >> strdata = list( fmt%xi for xi in x) >> Nice because the counter name does not "bleed" into your program. On Thu, 13 Mar 2008, David Huard apparently wrote: > ['S%03d'%i for i in int_data] The difference is that the counter "bleeds" from th

Re: [Numpy-discussion] Transforming an array of numbers to an array of formatted strings

2008-03-13 Thread Alexander Michael
On Thu, Mar 13, 2008 at 9:49 AM, Alan G Isaac <[EMAIL PROTECTED]> wrote: > And for 1d array ``x`` you can always do:: > >strdata = list( fmt%xi for xi in x) > > Nice because the counter name does not "bleed" into your program. On Thu, Mar 13, 2008 at 3:07 PM, David Huard <[EMAIL PROTECTED]> wr

[Numpy-discussion] subset of array - statistics

2008-03-13 Thread bevan
Hello, I am new to the world of Python and numpy but am very excited by what I have seen so far. I have been playing around with some rainfall data. The data is daily rainfall for a period, say 30 years in the form: Year Month JulianDay Rain (mm) 1970 1 1 0.0 1970 1 2

Re: [Numpy-discussion] Help needed with numpy 10.5 release blockers

2008-03-13 Thread Barry Wark
I appologize that the Mac OSX buildbot has been so flakey. For some reason it stops being able to resolve scipy.org on a regular basis (though other processes on the same machine don't seem to have trouble). Restarting the slave fixes the issue. Anyways, if anyone is testing an OS X issue and the s

[Numpy-discussion] fromiter + dtype='S' -> Python crash

2008-03-13 Thread Alan G Isaac
On Thu, 13 Mar 2008, Alexander Michael apparently wrote: > I wasn't sure if there was a magic numpy > method to do the loop quickly (as the destination array is created > beforehand) without creating a temporary Python list, but I guess not. > The generator/list-comprehension is likely better th

[Numpy-discussion] fromfunction() bug?

2008-03-13 Thread OrionBelt
Hi, According to the fromfunction() example: http://www.scipy.org/Numpy_Example_List_With_Doc#head-597e63df5a6d490abd474ffd84d0419468c8329a fromfunction() should return an array of integers. But when i run the example, i obtain an array of floats: >>> from numpy import * >>> def f(i,j): ...

Re: [Numpy-discussion] fromfunction() bug?

2008-03-13 Thread Alan G Isaac
This is how I would hope ``fromfunction`` would work and it matches the docs. (See below.) You can fix the example ... Cheers, Alan Isaac >>> help(N.fromfunction) Help on function fromfunction in module numpy.core.numeric: fromfunction(function, shape, **kwargs) Returns an array constructe

Re: [Numpy-discussion] fromfunction() bug?

2008-03-13 Thread orionbelt2
On Thu, Mar 13, 2008 at 06:18:30PM -0400, Alan G Isaac wrote: > This is how I would hope ``fromfunction`` would work > and it matches the docs. (See below.) You can fix > the example ... Interesting, i thought the output in the Example List page is auto-generated... ___

Re: [Numpy-discussion] subset of array - statistics

2008-03-13 Thread Joris De Ridder
I am new to the world of Python and numpy Welcome. I have successfully imported the data into lists and then created a single array from the lists. I think putting each quantity in a 1D array is more practical in this case. I can get the rainfall total over the entire period using: