[Numpy-discussion] question about a data structure

2009-07-29 Thread Ernest Adrogué
Hello, 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 a1 b 2 0 c 5 in the event 'b-a' the data is 2, and in the event 'c-a' is

Re: [Numpy-discussion] question about a data structure

2009-07-29 Thread Robert Kern
2009/7/29 Ernest Adrogué : > Hello, > > 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

Re: [Numpy-discussion] question about a data structure

2009-07-29 Thread Christopher Barker
Robert Kern wrote: > 2009/7/29 Ernest Adrogué : >> Now, I need to be able to differentiate between 0 and 'no data'. >> Is it possible to do this with the standard array class? > > Not really. Use masked arrays. Or use a dictionary. masked arrays are made precisely for this. However, if you can u

Re: [Numpy-discussion] question about a data structure

2009-07-30 Thread Ernest Adrogué
29/07/09 @ 14:54 (-0700), thus spake Christopher Barker: > Robert Kern wrote: > > 2009/7/29 Ernest Adrogué : > >> Now, I need to be able to differentiate between 0 and 'no data'. > > >> Is it possible to do this with the standard array class? > > > > Not really. Use masked arrays. Or use a dictio