Re: [Numpy-discussion] A bit of advice?

2011-06-24 Thread Neal Becker
josef.p...@gmail.com wrote: > On Thu, Jun 23, 2011 at 8:20 AM, Neal Becker wrote: >> Olivier Delalleau wrote: >> >>> What about : >>> dict((k, [e for e in arr if (e['x0'], e['x1']) == k]) for k in cases) >>> ? >> >> Not bad! Thanks! >> >> BTW, is there an easier way to get the unique keys, then

Re: [Numpy-discussion] A bit of advice?

2011-06-23 Thread josef . pktd
On Thu, Jun 23, 2011 at 8:20 AM, Neal Becker wrote: > Olivier Delalleau wrote: > >> What about : >> dict((k, [e for e in arr if (e['x0'], e['x1']) == k]) for k in cases) >> ? > > Not bad!  Thanks! > > BTW, is there an easier way to get the unique keys, then this: > > cases = tuple (set (tuple((e['

Re: [Numpy-discussion] A bit of advice?

2011-06-23 Thread Neal Becker
Olivier Delalleau wrote: > What about : > dict((k, [e for e in arr if (e['x0'], e['x1']) == k]) for k in cases) > ? Not bad! Thanks! BTW, is there an easier way to get the unique keys, then this: cases = tuple (set (tuple((e['a'],e['b'])) for e in u)) > > (note: it is inefficient written thi

Re: [Numpy-discussion] A bit of advice?

2011-06-23 Thread Olivier Delalleau
What about : dict((k, [e for e in arr if (e['x0'], e['x1']) == k]) for k in cases) ? (note: it is inefficient written this way though) -=- Olivier 2011/6/23 Neal Becker > I have a set of experiments that I want to plot. There will be many plots. > Each will show different test conditions. > >

[Numpy-discussion] A bit of advice?

2011-06-23 Thread Neal Becker
I have a set of experiments that I want to plot. There will be many plots. Each will show different test conditions. Suppose I put each of the test conditions and results into a recarray. The recarray could be: arr = np.empty ((#experiments,), dtype=[('x0',int), ('x1',int), ('y0',int)] wher