A reimplementation of MaskedArray + MaskedRecords

Pierre GM pgmdevlist at mailcan.com
Sun Oct 22 23:21:56 CDT 2006

I updated the alternative implementation of MaskedArray on the wiki, mainly to 
correct a couple of bugs. 

In addition, I attached another file, maskedrecordarray, which introduce a new 
class, MaskedRecord, as a subclass of recarray and MaskedArray. An instance 
of this class accepts a recarray as data, and uses two masks: the 
'recordmask' has as many entries as records in the array, each entry with the 
same fields as a record, but of boolean types, indicating whether a field is 
masked or not; an entry is flagged as masked in the 'mask' array if at least 
one field is masked. The 'mask' object is introduced mostly for compatibilty 
with MaskedArray, only 'recordmask' is really useful.

A few examples in the file should give you an idea of what can be done. In 
particular, you can define a new maskedrecord array as simply as ;
a = masked_record([('Alan',29,200.), ('Bill',31,260.0)], 
dtype=[('name','S30'),('age',int_),('weight',float_)], mask=[(1,0,0), 

Note that maskedrecordarray is still quite experimental. As I'm not a regular 
user of records, I don't really know what should be implemented... The file 
can be accessed at

Once again, I need your comments and suggestions !


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

More information about the Numpy-discussion mailing list