[Numpy-discussion] question about a data structure

Ernest Adrogué eadrogue@gmx....
Wed Jul 29 16:36:39 CDT 2009


Suppose I want to store some data (a non-negative integer)
related to an "event" involving two entities. It occurs to me that
the way to do it is using a 2-d array, like a table:

For example:

  a  b  c
a    1
b 2     0
c 5      

in the event 'b-a' the data is 2, and in the event 'c-a' is 5, etc.

Now, I need to be able to differentiate between 0 and 'no data'.
I know I could use a number like -1, but this would affect arithmetic
operations on the array, and also I need that indexing one such
location with no data returns an empty array.

Is it possible to do this with the standard array class?



More information about the NumPy-Discussion mailing list