records.Record
object. It has these methods:
fieldName) |
fieldname, value) |
RecArray
, a Record
object has the field
method to get the field value. But since a Record
object
is not an array, it does not take an index or slice, so one cannot
assign a value to it. So a separate set method, setfield()
,
is necessary:
>>> r[1].field(0) 999 >>> r[1].setfield(0, -1) >>> print r[1] (-1, 'xy', 1000.0)
field()
method in RecArray
, fieldName
in
Record
's field()
and setfield()
methods can be
either an integer (index) or a string (field name).
Send comments to the NumArray community.