Re: [Numpy-discussion] Warning or error on conversion from complex to float.

2007-11-08 Thread Charles R Harris
On Nov 8, 2007 11:32 AM, Michael McNeil Forbes <[EMAIL PROTECTED]> wrote: > Hi, > > Is it possible or easy to add a warning and/or error when array > assignments are made that lose information? I just got caught with > the following type of code: > > def f(): > return numpy.array([1j,2.0]) >

[Numpy-discussion] Warning or error on conversion from complex to float.

2007-11-08 Thread Michael McNeil Forbes
Hi, Is it possible or easy to add a warning and/or error when array assignments are made that lose information? I just got caught with the following type of code: def f(): return numpy.array([1j,2.0]) x = numpy.empty((2,),dtype=float) x[:] = f() I am pre-allocating arrays for speed, b