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

Sebastian Haase haase at msg.ucsf.edu
Tue Aug 22 12:33:53 EDT 2006


Hi,
probably related to this is that
arr[2].real is read-only ...

I noticed that you cannot assign 
to arr[2].real :

>>> a[2].real =6
Traceback (most recent call last):
  File "<input>", line 1, in ?
TypeError: attribute 'real' of 'genericscalar' objects is not writable
>>> a.real[2] =6
>>> 
>>> a[2].real.flags
  CONTIGUOUS : True
  FORTRAN : True
  OWNDATA : True
  WRITEABLE : False
  ALIGNED : True
  UPDATEIFCOPY : False
>>> a.real[2].flags
 <snipped unchanged fields>
  WRITEABLE : False
>>> 
>>> a.real.flags
  CONTIGUOUS : False
  FORTRAN : False
  OWNDATA : False
  WRITEABLE : True
>>> a[2].flags
  CONTIGUOUS : True
  FORTRAN : True
  OWNDATA : True
  WRITEABLE : False
  ALIGNED : True
  UPDATEIFCOPY : False

Is the "not writable" restriction necessary ?

Thanks,
Sebastian Haase



On Tuesday 22 August 2006 01:46, Albert Strasheim wrote:
> Hello all
>
> > <snip>
> >
> > >>> a = N.arange(4, dtype='>c8')
> > >>> a.imag.max()
> >
> > 4.60060298822e-41
>
> Confirmed on Windows 32-bit with 1.0b4.dev3050.
>
> I created a ticket here:
>
> http://projects.scipy.org/scipy/numpy/ticket/265
>
> Regards,
>
> Albert
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> 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