Re: [Numpy-discussion] Advice on converting iterator into array efficiently

2008-08-31 Thread Francesc Alted
A Saturday 30 August 2008, Alan Jackson escrigué: > I tested all three offered solutions : > > t = table[:] # convert to structured array > collections = np.unique(t['collection']) > for collection in collections: > cond = t['collection'] == collection > energy_this_collection = t['energy']

Re: [Numpy-discussion] Advice on converting iterator into array efficiently

2008-08-29 Thread Alan Jackson
I tested all three offered solutions : t = table[:] # convert to structured array collections = np.unique(t['collection']) for collection in collections: cond = t['collection'] == collection energy_this_collection = t['energy'][cond] -- energies = {} for ro

Re: [Numpy-discussion] Advice on converting iterator into array efficiently

2008-08-29 Thread Francesc Alted
A Friday 29 August 2008, Francesc Alted escrigué: > A Friday 29 August 2008, Alan Jackson escrigué: > > Looking for advice on a good way to handle this problem. > > > > I'm dealing with large tables (Gigabyte large). I would like to > > efficiently subset values from one column based on the values

Re: [Numpy-discussion] Advice on converting iterator into array efficiently

2008-08-29 Thread Francesc Alted
A Friday 29 August 2008, Alan Jackson escrigué: > Looking for advice on a good way to handle this problem. > > I'm dealing with large tables (Gigabyte large). I would like to > efficiently subset values from one column based on the values in > another column, and get arrays out of the operation. Fo

Re: [Numpy-discussion] Advice on converting iterator into array efficiently

2008-08-28 Thread Andrew Straw
Alan Jackson wrote: > Looking for advice on a good way to handle this problem. > > I'm dealing with large tables (Gigabyte large). I would like to > efficiently subset values from one column based on the values in > another column, and get arrays out of the operation. For example, > say I have 2 c

[Numpy-discussion] Advice on converting iterator into array efficiently

2008-08-28 Thread Alan Jackson
Looking for advice on a good way to handle this problem. I'm dealing with large tables (Gigabyte large). I would like to efficiently subset values from one column based on the values in another column, and get arrays out of the operation. For example, say I have 2 columns, "energy" and "collectio