Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-14 Thread Christopher Barker
Charles R Harris wrote: >> > Why not simply >> > write a wrapper function in python that does Numeric-style guesswork, >> > and put it in the compatibility modules? >> Can I encourage any more comments? +1 > The main problem in constructing arrays > of objects is more information needs to be s

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-13 Thread Charles R Harris
On 9/13/06, Matthew Brett <[EMAIL PROTECTED]> wrote: Hi,> For example, if you do array([a,b,c]).shape(), the answer is normally> (3,) unless a b and c happen to all be lists of the same length, at> which point your array could have a much more complicated shape... but > as the person who wrote "arr

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-13 Thread Matthew Brett
Hi, > For example, if you do array([a,b,c]).shape(), the answer is normally > (3,) unless a b and c happen to all be lists of the same length, at > which point your array could have a much more complicated shape... but > as the person who wrote "array([a,b,c])" it's tempting to assume that > the r

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread A. M. Archibald
Maybe I should stay out of this, but it seems like constructing object arrays is complicated and involves a certain amount of guesswork on the part of Numeric. For example, if you do array([a,b,c]).shape(), the answer is normally (3,) unless a b and c happen to all be lists of the same length, at

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread Charles R Harris
On 9/7/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:>> So is this intentional?>> In [24]: a = array([[],[],[]], dtype=object)>> In [25]: a.shape> Out[25]: (3, 0)>> In [26]: a = array([], dtype=object) >> In [27]: a.shape> Out[27]: (0,)>> One

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread Travis Oliphant
Charles R Harris wrote: > > So is this intentional? > > In [24]: a = array([[],[],[]], dtype=object) > > In [25]: a.shape > Out[25]: (3, 0) > > In [26]: a = array([], dtype=object) > > In [27]: a.shape > Out[27]: (0,) > > One could argue that the first array s

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread Charles R Harris
On 9/7/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 9/7/06, Travis Oliphant < [EMAIL PROTECTED]> wrote: Charles R Harris wrote:> On 9/6/06, *Charles R Harris* <[EMAIL PROTECTED]> [EMAIL PROTECTED] >> wrote: On 9/6/06, *Travis Oliphant* < [EMAIL PROTECTED] > [EMAIL PROTECTED]>> wr

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread Charles R Harris
On 9/7/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:> On 9/6/06, *Charles R Harris* <[EMAIL PROTECTED]> [EMAIL PROTECTED] >> wrote: On 9/6/06, *Travis Oliphant* < [EMAIL PROTECTED]> [EMAIL PROTECTED]>> wrote:>> Charles R Harris wrote:> >>   

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-07 Thread Travis Oliphant
Charles R Harris wrote: > OK. I do have a couple of questions. Let me insert the docs for array > and asarray : > > """array(object, dtype=None, copy=1,order=None, subok=0,ndmin=0) > > Return an array from object with the specified date-type. > > 1) Is it true that array doesn't always ret

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread Travis Oliphant
Charles R Harris wrote: > On 9/6/06, *Charles R Harris* <[EMAIL PROTECTED] > > wrote: > > > > On 9/6/06, *Travis Oliphant* < [EMAIL PROTECTED] > > wrote: > > Charles R Harris wrote: > > > > Where is array at this p

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread A. M. Archibald
On 06/09/06, Charles R Harris <[EMAIL PROTECTED]> wrote: > On 9/6/06, Charles R Harris <[EMAIL PROTECTED]> wrote: > > > order - Specify the order of the array. If order is 'C', then the > > array will be in C-contiguous order (last-index varies the > > fastes

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread Charles R Harris
On 9/6/06, Charles R Harris <[EMAIL PROTECTED]> wrote: On 9/6/06, Travis Oliphant < [EMAIL PROTECTED]> wrote: Charles R Harris wrote:>> Where is array at this point?Basically it supports the old Numeric behavior wherein object array'sare treated as before *except* for when an error would have occur

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread Charles R Harris
On 9/6/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Charles R Harris wrote:>> Where is array at this point?Basically it supports the old Numeric behavior wherein object array'sare treated as before *except* for when an error would have occurredpreviously when the "new behavior" kicks in.  Anythin

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread Travis Oliphant
Charles R Harris wrote: > > Where is array at this point? Basically it supports the old Numeric behavior wherein object array's are treated as before *except* for when an error would have occurred previously when the "new behavior" kicks in. Anything that violates that is a bug needing to be fi

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-06 Thread Charles R Harris
On 9/5/06, Travis Oliphant <[EMAIL PROTECTED]> wrote: Matthew Brett wrote:> Hi, This is a result of PyArray_FromAny changing when object arrays are>> explicitly requested (which they are in this case --- although behind>> the scenes). Hmm - I think I am hitting a related bug/feature/surpri

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-05 Thread Travis Oliphant
Matthew Brett wrote: > Hi, > > >> This is a result of PyArray_FromAny changing when object arrays are >> explicitly requested (which they are in this case --- although behind >> the scenes). >> > > Hmm - I think I am hitting a related bug/feature/surprising change in > behavior, which is sh

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-05 Thread Travis Oliphant
Matthew Brett wrote: > Hi, > > >> This is a result of PyArray_FromAny changing when object arrays are >> explicitly requested (which they are in this case --- although behind >> the scenes). >> > > Hmm - I think I am hitting a related bug/feature/surprising change in > behavior, which is sh

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-05 Thread Matthew Brett
Hi, > This is a result of PyArray_FromAny changing when object arrays are > explicitly requested (which they are in this case --- although behind > the scenes). Hmm - I think I am hitting a related bug/feature/surprising change in behavior, which is showing up rather obscurely in a failure of the

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-04 Thread Travis Oliphant
Fernando Perez wrote: > Hi all, > > I'm wondering if the following difference in behavior of object arrays should > be considered a bug. Let a and b be: > > In [21]: a = [0,1] > > In [22]: b = [ None, None] > > If we concatenate a with an empty list, it works: > > In [23]: numpy.concatenate(([],a

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-04 Thread Fernando Perez
On 9/3/06, Robert Kern <[EMAIL PROTECTED]> wrote: > > I think it's propably a bug: > > > > >>> concatenate((array([]),b)) > > array([None, None], dtype=object) > > Well, if you can fix it without breaking anything else, then it's a bug. > > However, I would suggest that a rule of thumb for using

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-03 Thread Robert Kern
Charles R Harris wrote: > On 9/3/06, *Fernando Perez* <[EMAIL PROTECTED] > > wrote: > > Hi all, > > I'm wondering if the following difference in behavior of object > arrays should > be considered a bug. Let a and b be: > > In [21]: a = [0,1] > >

Re: [Numpy-discussion] Problem with concatenate and object arrays

2006-09-03 Thread Charles R Harris
On 9/3/06, Fernando Perez <[EMAIL PROTECTED]> wrote: Hi all,I'm wondering if the following difference in behavior of object arrays shouldbe considered a bug.  Let a and b be:In [21]: a = [0,1]In [22]: b = [ None, None]If we concatenate a with an empty list, it works: In [23]: numpy.concatenate(([],

[Numpy-discussion] Problem with concatenate and object arrays

2006-09-03 Thread Fernando Perez
Hi all, I'm wondering if the following difference in behavior of object arrays should be considered a bug. Let a and b be: In [21]: a = [0,1] In [22]: b = [ None, None] If we concatenate a with an empty list, it works: In [23]: numpy.concatenate(([],a)) Out[23]: array([0, 1]) But not so for