[Numpy-discussion] storing magnitude data

Tim Hochberg tim.hochberg at cox.net
Mon Aug 15 12:05:21 CDT 2005


Daniel Sheltraw wrote:

> Hello All
>
> Would someone please tell me how to store magnitude data in the first 
> half of
> a previously allocated complex array (I need to save memory). Memory 
> saving
> things like this are so simple and intuitive in C but less so in NumPy.

 >>> a = 3*na.arange(10) + 4*na.arange(10)*1j
 >>> na.absolute(a, a.real)
 >>> a.real
array([  0.,   5.,  10.,  15.,  20.,  25.,  30.,  35.,  40.,  45.])


>
> Thanks,
> Daniel
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle 
> Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing 
> & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
>
>






More information about the Numpy-discussion mailing list