Re: [Numpy-discussion] real and imag functions should produce errors for object arrays

2010-09-21 Thread Matthew Brett
Hi, > I see that I have interpreted this thread as "Doctor, it hurts when I do > this...  Well, don't do that!"  Sorry for the noise. It's all good - a reply is almost always more friendly and helpful than no reply ;) See you, Matthew ___ NumPy-Discus

Re: [Numpy-discussion] real and imag functions should produce errors for object arrays

2010-09-21 Thread Robert Kern
On Tue, Sep 21, 2010 at 17:40, Pauli Virtanen wrote: > Tue, 21 Sep 2010 17:28:08 -0500, Robert Kern wrote: > [clip] >>> *that* == return a complex number from .real >> >> What is the alternative? I'm personally happy with saying that many of >> the operations we define on numpy arrays can be done

Re: [Numpy-discussion] real and imag functions should produce errors for object arrays

2010-09-21 Thread Pauli Virtanen
Tue, 21 Sep 2010 17:28:08 -0500, Robert Kern wrote: [clip] >> *that* == return a complex number from .real > > What is the alternative? I'm personally happy with saying that many of > the operations we define on numpy arrays can be done because we know the > types and that object arrays subvert th

Re: [Numpy-discussion] real and imag functions should produce errors for object arrays

2010-09-21 Thread Matthew Brett
Hi, On Tue, Sep 21, 2010 at 3:28 PM, Robert Kern wrote: > On Tue, Sep 21, 2010 at 17:17, Pauli Virtanen wrote: >> Tue, 21 Sep 2010 21:50:08 +, Pauli Virtanen wrote: >> >>> Tue, 21 Sep 2010 17:31:55 -0400, Michael Gilbert wrote: The following example demonstrates a rather unexpected resu

Re: [Numpy-discussion] real and imag functions should produce errors for object arrays

2010-09-21 Thread Robert Kern
On Tue, Sep 21, 2010 at 17:17, Pauli Virtanen wrote: > Tue, 21 Sep 2010 21:50:08 +, Pauli Virtanen wrote: > >> Tue, 21 Sep 2010 17:31:55 -0400, Michael Gilbert wrote: >>> The following example demonstrates a rather unexpected result: >>> >> import numpy >> x = numpy.array( complex( 1.0

Re: [Numpy-discussion] real and imag functions should produce errors for object arrays

2010-09-21 Thread Benjamin Root
On Tue, Sep 21, 2010 at 4:44 PM, Benjamin Root wrote: > On Tue, Sep 21, 2010 at 4:31 PM, Michael Gilbert < > michael.s.gilb...@gmail.com> wrote: > >> Hi, >> >> The following example demonstrates a rather unexpected result: >> >> >>> import numpy >> >>> x = numpy.array( complex( 1.0 , 1.0 ) , nump

Re: [Numpy-discussion] real and imag functions should produce errors for object arrays

2010-09-21 Thread Pauli Virtanen
Tue, 21 Sep 2010 21:50:08 +, Pauli Virtanen wrote: > Tue, 21 Sep 2010 17:31:55 -0400, Michael Gilbert wrote: >> The following example demonstrates a rather unexpected result: >> > import numpy > x = numpy.array( complex( 1.0 , 1.0 ) , numpy.object ) >> print x.real >> (1+1j) > pri

Re: [Numpy-discussion] real and imag functions should produce errors for object arrays

2010-09-21 Thread Pauli Virtanen
Tue, 21 Sep 2010 17:31:55 -0400, Michael Gilbert wrote: > The following example demonstrates a rather unexpected result: > import numpy x = numpy.array( complex( 1.0 , 1.0 ) , numpy.object ) > print x.real > (1+1j) print x.imag > 0 > > Shouldn't real and imag return an error in suc

Re: [Numpy-discussion] real and imag functions should produce errors for object arrays

2010-09-21 Thread Matthew Brett
Hi, On Tue, Sep 21, 2010 at 2:44 PM, Benjamin Root wrote: > On Tue, Sep 21, 2010 at 4:31 PM, Michael Gilbert > wrote: >> >> Hi, >> >> The following example demonstrates a rather unexpected result: >> >> >>> import numpy >> >>> x = numpy.array( complex( 1.0 , 1.0 ) , numpy.object ) >> >>> print x

Re: [Numpy-discussion] real and imag functions should produce errors for object arrays

2010-09-21 Thread Benjamin Root
On Tue, Sep 21, 2010 at 4:31 PM, Michael Gilbert < michael.s.gilb...@gmail.com> wrote: > Hi, > > The following example demonstrates a rather unexpected result: > > >>> import numpy > >>> x = numpy.array( complex( 1.0 , 1.0 ) , numpy.object ) > >>> print x.real > (1+1j) > >>> print x.imag > 0 > > S

[Numpy-discussion] real and imag functions should produce errors for object arrays

2010-09-21 Thread Michael Gilbert
Hi, The following example demonstrates a rather unexpected result: >>> import numpy >>> x = numpy.array( complex( 1.0 , 1.0 ) , numpy.object ) >>> print x.real (1+1j) >>> print x.imag 0 Shouldn't real and imag return an error in such a situation? Thanks, Mike ___