Re: [Numpy-discussion] non-intuitive behaviour in numpy.array([list], numpy.object_)

2008-01-03 Thread Garnet Chan
Thanks - that's clear I guess, although I still think that it might be less confusing if numpy did not try to be clever! On 1/3/08, Christopher Barker <[EMAIL PROTECTED]> wrote: > Garnet Chan wrote: > > When constructing an numpy object array from a list of numpy arrays, > > one observes the follo

Re: [Numpy-discussion] non-intuitive behaviour in numpy.array([list], numpy.object_)

2008-01-03 Thread Christopher Barker
Garnet Chan wrote: > When constructing an numpy object array from a list of numpy arrays, > one observes the following behaviour > import numpy as N a=[N.zeros([2,2], N.object_), N.zeros([2,2], N.object_)] b=N.array(a, N.object_) print b.shape > (2, 2, 2) a=[N.zeros([2,2],

[Numpy-discussion] non-intuitive behaviour in numpy.array([list], numpy.object_)

2008-01-03 Thread Garnet Chan
When constructing an numpy object array from a list of numpy arrays, one observes the following behaviour >>> import numpy as N >>> a=[N.zeros([2,2], N.object_), N.zeros([2,2], N.object_)] >>> b=N.array(a, N.object_) >>> print b.shape (2, 2, 2) >>> a=[N.zeros([2,2], N.object_), N.zeros([2,1], N.ob