El dl 30 de 04 del 2007 a les 17:27 +0000, en/na Matt Knox va escriure:
> Hi everyone,
>  
> I've been toying around with the idea of creating a maskedEArray class
> which would behave the same as EArray except it would handle masked
> arrays (and hence, missing data points). I can't quite think of an
> efficient way to do this at the moment though.
>  
> Subclassing EArray is not a problem in and of itself. I was able to
> create a subclass of File and EArray and read and write my new
> sub-class with no problems. It is easy to add some custom attributes
> to my class that are handled also. That is the good news.
>  
> The tricky part comes when I try to figure out a way to represent the
> missing values. A really simple way to do this would be to store a
> separate boolean EArray corresponding to the mask for each masked
> array. However, I'd prefer to keep the information for one masked
> array contained within a single node from an organizational point of
> view. Similarly, I could store a boolean array as an attribute for
> each EArray, but as far as I know you can't read just a portion of an
> array attribute, it would be an all or nothing propisition which means
> if I wanted to read just a single data point I'd have to read the
> entire mask too.

After pondering a bit the different possibilities, I think that a Table
would be the best candidate for doing what you want.  The Table is just
like an EArray, but allows you to have different columns with different
types in the same data container. So, in one column you can keep the
actual data and, in the other, the boolean that says if the data in the
same row is valid or not.

I should note that the Table object is unidimensional by itself.
However, if what you want is to keep multidimensional data, you can
still do this by declaring the data column as multidimensional (and also
the boolean column if this is what you want), so in most of cases this
is not an actual limitation.

HTH,

-- 
Francesc Altet    |  Be careful about using the following code --
Carabos Coop. V.  |  I've only proven that it works, 
www.carabos.com   |  I haven't tested it. -- Donald Knuth


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users

Reply via email to