[Numpy-discussion] bug is arr.real for byteswapped array

Travis Oliphant oliphant.travis at ieee.org
Tue Aug 22 14:15:36 CDT 2006


Sebastian Haase wrote:
> Hi,
> probably related to this is that
> arr[2].real is read-only ...
>
> I noticed that you cannot assign 
> to arr[2].real :
>   
No, that's unrelated.  The problem is that arr[2] is a scalar and so it 
is immutable.  When an array scalar is created you get a *copy* of the 
data.  Setting it would not have the effect you imagine as the original 
data would go unchanged.

The only exception to this is the array of type "void" which *does not* 
copy the data.

-Travis





More information about the Numpy-discussion mailing list