Re: [Numpy-discussion] Float view of complex array

2015-01-28 Thread Jens Jørgen Mortensen
Den 27-01-2015 kl. 12:25 skrev Jaime Fernández del Río: On Mon, Jan 26, 2015 at 10:28 PM, Jens Jørgen Mortensen mailto:je...@fysik.dtu.dk>> wrote: On 01/26/2015 11:02 AM, Jaime Fernández del Río wrote: > On Mon, Jan 26, 2015 at 1:41 AM, Sebastian Berg > mailto:sebast...@sipsolutions

Re: [Numpy-discussion] Float view of complex array

2015-01-27 Thread Jaime Fernández del Río
On Mon, Jan 26, 2015 at 10:28 PM, Jens Jørgen Mortensen wrote: > On 01/26/2015 11:02 AM, Jaime Fernández del Río wrote: > > On Mon, Jan 26, 2015 at 1:41 AM, Sebastian Berg > > mailto:sebast...@sipsolutions.net>> wrote: > > > > On Mo, 2015-01-26 at 09:24 +0100, Jens Jørgen Mortensen wrote: > >

Re: [Numpy-discussion] Float view of complex array

2015-01-26 Thread Jens Jørgen Mortensen
On 01/26/2015 11:02 AM, Jaime Fernández del Río wrote: > On Mon, Jan 26, 2015 at 1:41 AM, Sebastian Berg > mailto:sebast...@sipsolutions.net>> wrote: > > On Mo, 2015-01-26 at 09:24 +0100, Jens Jørgen Mortensen wrote: > > Hi! > > > > I have a view of a 2-d complex array that I would

Re: [Numpy-discussion] Float view of complex array

2015-01-26 Thread Sebastian Berg
On Mo, 2015-01-26 at 02:02 -0800, Jaime Fernández del Río wrote: > On Mon, Jan 26, 2015 at 1:41 AM, Sebastian Berg > wrote: > On Mo, 2015-01-26 at 09:24 +0100, Jens Jørgen Mortensen wrote: > > Hi! > > > > I have a view of a 2-d complex array that I would like to >

Re: [Numpy-discussion] Float view of complex array

2015-01-26 Thread Jaime Fernández del Río
On Mon, Jan 26, 2015 at 1:41 AM, Sebastian Berg wrote: > On Mo, 2015-01-26 at 09:24 +0100, Jens Jørgen Mortensen wrote: > > Hi! > > > > I have a view of a 2-d complex array that I would like to view as a 2-d > > float array. This works OK: > > > > >>> np.ones((2, 4), complex).view(float) > > ar

Re: [Numpy-discussion] Float view of complex array

2015-01-26 Thread Sebastian Berg
On Mo, 2015-01-26 at 09:24 +0100, Jens Jørgen Mortensen wrote: > Hi! > > I have a view of a 2-d complex array that I would like to view as a 2-d > float array. This works OK: > > >>> np.ones((2, 4), complex).view(float) > array([[ 1., 0., 1., 0., 1., 0., 1., 0.], > [ 1., 0., 1

Re: [Numpy-discussion] Float view of complex array

2015-01-26 Thread Maniteja Nandana
Hi Jens, I don't have enough knowledge about the internal memory layout, but the documentation ndarray.view says that: Views that change the dtype size (bytes per entry) should normally be avoided on arrays defined by s

[Numpy-discussion] Float view of complex array

2015-01-26 Thread Jens Jørgen Mortensen
Hi! I have a view of a 2-d complex array that I would like to view as a 2-d float array. This works OK: >>> np.ones((2, 4), complex).view(float) array([[ 1., 0., 1., 0., 1., 0., 1., 0.], [ 1., 0., 1., 0., 1., 0., 1., 0.]]) but this doesn't: >>> np.ones((2, 4), complex)