Re: [Numpy-discussion] dtype from |S10 to object in array?

2010-09-23 Thread Travis Oliphant
Assignment will never change the data-type of an already allocated array. So, x['f2'] = y will try to convert the array to 'S10'. On my system I get: array([(1, 2.0, 'Hello'), (2, 3.0, 'World')], dtype=[('f0', ' Dear All, > > See below code pls, > > import sicpy > import numpy as np

Re: [Numpy-discussion] [PATCH] F2Py on Python 3

2010-09-23 Thread Charles R Harris
On Thu, Sep 23, 2010 at 7:22 PM, Lisandro Dalcin wrote: > On 23 September 2010 01:26, Charles R Harris > wrote: > > > > > > On Wed, Sep 22, 2010 at 10:00 PM, Charles R Harris > > wrote: > >> > >> > >> On Wed, Sep 22, 2010 at 9:14 PM, Fernando Perez > >> wrote: > >>> > >>> On Wed, Sep 22, 2010

Re: [Numpy-discussion] [PATCH] F2Py on Python 3

2010-09-23 Thread Lisandro Dalcin
On 23 September 2010 01:26, Charles R Harris wrote: > > > On Wed, Sep 22, 2010 at 10:00 PM, Charles R Harris > wrote: >> >> >> On Wed, Sep 22, 2010 at 9:14 PM, Fernando Perez >> wrote: >>> >>> On Wed, Sep 22, 2010 at 7:16 PM, Charles R Harris >>> wrote: >>> > >>> > Done in  29cccb6. >>> > >>> >

[Numpy-discussion] Commit mailing list

2010-09-23 Thread Stéfan van der Walt
Hi all, The commit mailing list is running again. Regards Stéfan ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] slicing / indexing question

2010-09-23 Thread Timothy W. Hilton
Hi Brett, Josef, Gökhan, and Anne, Many thanks for the suggestions! This indexing problem was not as straight-forward as I had anticipated. I have it working now, thanks to your help. Gökhan, I'm driving an ecosystem--atmosphere carbon dioxide flux model with MODIS measurements, so this_par and

Re: [Numpy-discussion] A proposed change to rollaxis() behavior for negative 'start' values

2010-09-23 Thread Nathaniel Smith
On Tue, Sep 21, 2010 at 12:48 PM, Ken Basye wrote: > If that's going to break too much code, here's a pathway that might be > acceptable:  Add a new function moveaxis() which works the way > rollaxis() does for positive arguments but in the new way for negative > arguments.  Eventually, rollaxis c

Re: [Numpy-discussion] A proposed change to rollaxis() behavior for negative 'start' values

2010-09-23 Thread Ryan May
On Thu, Sep 23, 2010 at 10:32 AM, Anne Archibald wrote: > Just a quick correction: len(a) gives a.shape[0], while what you want > is actually len(a.shape). So: > > In [1]: a = np.zeros((2,3,4,5,6)) > > In [2]: len(a) > Out[2]: 2 > > In [8]: np.rollaxis(a,0,len(a.shape)).shape > Out[8]: (3, 4, 5, 6

Re: [Numpy-discussion] A proposed change to rollaxis() behavior for negative 'start' values

2010-09-23 Thread Anne Archibald
On 23 September 2010 02:20, Ralf Gommers wrote: > > > On Wed, Sep 22, 2010 at 4:14 AM, Anne Archibald > wrote: >> >> Hi Ken, >> >> This is a tricky one. The current behaviour of rollaxis is to remove >> the requested axis from the list of axes and then insert it before the >> axis specified. This

Re: [Numpy-discussion] Asking for opinions: Priops

2010-09-23 Thread Dag Sverre Seljebotn
Dag Sverre Seljebotn wrote: > Friedrich Romstedt wrote: > >> I just ran across the problem of priorities with ndarrays again and it >> keeps biting me. I did once ago a workaround to get my ``undarray`` >> class's methods be called when being the second operand of e.g. >> + . But since I wrot

Re: [Numpy-discussion] Asking for opinions: Priops

2010-09-23 Thread Dag Sverre Seljebotn
Friedrich Romstedt wrote: > I just ran across the problem of priorities with ndarrays again and it > keeps biting me. I did once ago a workaround to get my ``undarray`` > class's methods be called when being the second operand of e.g. > + . But since I wrote it, always Python crashes > on exit w

Re: [Numpy-discussion] A proposed change to rollaxis(), behavior for negative 'start' values

2010-09-23 Thread Ken Basye
Anne says: This is a tricky one. The current behaviour of rollaxis is to remove the requested axis from the list of axes and then insert it before the axis specified. This is exactly how python's list insertion works: In [1]: a = range(10) In [3]: a.insert(-1,'a') In [4]

Re: [Numpy-discussion] Asking for opinions: Priops

2010-09-23 Thread Friedrich Romstedt
Hi Sebastian, Thanks for your reply! 2010/9/22 Sebastian Walter : > [...] I think the issue is not so much numpy but rather the > way Python implements operator overloading using methods like __add__ > and __radd__.  Hence, your suggestion seems to be a Python Enhancement > Proposal and should be

Re: [Numpy-discussion] A proposed change to rollaxis() behavior for negative 'start' values

2010-09-23 Thread Charles R Harris
On Thu, Sep 23, 2010 at 12:20 AM, Ralf Gommers wrote: > > > On Wed, Sep 22, 2010 at 4:14 AM, Anne Archibald < > aarch...@physics.mcgill.ca> wrote: > >> Hi Ken, >> >> This is a tricky one. The current behaviour of rollaxis is to remove >> the requested axis from the list of axes and then insert it