[Numpy-discussion] Recarray attributes writeable (3rd try) (original) (raw)
Erin Sheldon erin.sheldon at gmail.com
Fri Jun 16 11:27:54 EDT 2006
- Previous message (by thread): [Numpy-discussion] ImportError while creating a Python module using NumPy
- Next message (by thread): [Numpy-discussion] Segfault with simplest operation on extension module using numpy
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi everyone -
(this is my third try in the last 24 hours to post this. For some reason it hasn't been making it through)
Recarrays have convenience attributes such that fields may be accessed through "." in additioin to the "field()" method. These attributes are designed for read only; one cannot alter the data through them. Yet they are writeable:
tr=numpy.recarray(10, formats='i4,f8,f8', names='id,ra,dec') tr.field('ra')[:] = 0.0 tr.ra array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
tr.ra = 3 tr.ra 3 tr.field('ra') array([ 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
I feel this should raise an exception, just as with trying to write to the "size" attribute. Any thoughts?
Erin
- Previous message (by thread): [Numpy-discussion] ImportError while creating a Python module using NumPy
- Next message (by thread): [Numpy-discussion] Segfault with simplest operation on extension module using numpy
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]