Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Darren Dale
On Thu, May 20, 2010 at 12:07 PM, Bruce Southey wrote: > np.array is an array creating function that numpy.array takes a > array_like input and it *will* try to convert that input into an array. > (This also occurs when you give np.array a masked array as an input.) > This a 'feature' especially w

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread josef . pktd
On Thu, May 20, 2010 at 12:13 PM, Benjamin Root wrote: > > > On Thu, May 20, 2010 at 10:30 AM, Ryan May wrote: >> >> On Thu, May 20, 2010 at 9:44 AM, Benjamin Root wrote: >> >> I gave two counterexamples of why. >> > >> > The examples you gave aren't counterexamples.  See below... >> > >> > On W

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Benjamin Root
On Thu, May 20, 2010 at 10:30 AM, Ryan May wrote: > On Thu, May 20, 2010 at 9:44 AM, Benjamin Root wrote: > >> I gave two counterexamples of why. > > > > The examples you gave aren't counterexamples. See below... > > > > On Wed, May 19, 2010 at 7:06 PM, Darren Dale wrote: > >> > >> On Wed, May

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Bruce Southey
On 05/20/2010 10:53 AM, Darren Dale wrote: > [sorry, my last got cut off] > > On Thu, May 20, 2010 at 11:37 AM, Darren Dale wrote: > >> On Thu, May 20, 2010 at 10:44 AM, Benjamin Root wrote: >> I gave two counterexamples of why. >>> The examples you gave aren't count

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Darren Dale
[sorry, my last got cut off] On Thu, May 20, 2010 at 11:37 AM, Darren Dale wrote: > On Thu, May 20, 2010 at 10:44 AM, Benjamin Root wrote: >>> I gave two counterexamples of why. >> >> The examples you gave aren't counterexamples.  See below... > > I'm not interested in arguing over semantics. I'

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Darren Dale
On Thu, May 20, 2010 at 10:44 AM, Benjamin Root wrote: >> I gave two counterexamples of why. > > The examples you gave aren't counterexamples.  See below... I'm not interested in arguing over semantics. I've discovered an issue with how numpy deals with lists of objects that derive from ndarray,

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Ryan May
On Thu, May 20, 2010 at 9:44 AM, Benjamin Root wrote: >> I gave two counterexamples of why. > > The examples you gave aren't counterexamples.  See below... > > On Wed, May 19, 2010 at 7:06 PM, Darren Dale wrote: >> >> On Wed, May 19, 2010 at 4:19 PM,   wrote: >> > On Wed, May 19, 2010 at 4:08 PM,

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-20 Thread Benjamin Root
> > I gave two counterexamples of why. > The examples you gave aren't counterexamples. See below... On Wed, May 19, 2010 at 7:06 PM, Darren Dale wrote: > On Wed, May 19, 2010 at 4:19 PM, wrote: > > On Wed, May 19, 2010 at 4:08 PM, Darren Dale wrote: > >> I have a question about creation of

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-19 Thread Darren Dale
On Wed, May 19, 2010 at 4:19 PM, wrote: > On Wed, May 19, 2010 at 4:08 PM, Darren Dale wrote: >> I have a question about creation of numpy arrays from a list of >> objects, which bears on the Quantities project and also on masked >> arrays: >> > import quantities as pq > import numpy as

Re: [Numpy-discussion] question about creating numpy arrays

2010-05-19 Thread josef . pktd
On Wed, May 19, 2010 at 4:08 PM, Darren Dale wrote: > I have a question about creation of numpy arrays from a list of > objects, which bears on the Quantities project and also on masked > arrays: > import quantities as pq import numpy as np a, b = 2*pq.m,1*pq.s np.array([a, b])

[Numpy-discussion] question about creating numpy arrays

2010-05-19 Thread Darren Dale
I have a question about creation of numpy arrays from a list of objects, which bears on the Quantities project and also on masked arrays: >>> import quantities as pq >>> import numpy as np >>> a, b = 2*pq.m,1*pq.s >>> np.array([a, b]) array([ 12., 1.]) Why doesn't that create an object array? S