Hi Stephen,
>
> I'm looking for efficient ways to subtotal a 1-d array onto a 2-D
> grid. This
> is more easily explained in code that words, thus:
>
> for n in xrange(len(data)):
> totals[ i[n], j[n] ] += data[n]
>
> data comes from a series of PyTables files with ~200m rows. Each row
> has ~2
Thanks Francesc, but I am already planning to read the data in block-wise as
you suggest. My question is rather how best to update the subtotals for each
block in a parallel way using numpy efficiently, rather than a simplistic and
slow element-by-element loop.
I can't use a simple sum(), as in y
A Divendres 29 Desembre 2006 10:05, Stephen Simmons escrigué:
> Hi,
>
> I'm looking for efficient ways to subtotal a 1-d array onto a 2-D grid.
> This is more easily explained in code that words, thus:
>
> for n in xrange(len(data)):
> totals[ i[n], j[n] ] += data[n]
>
> data comes from a serie
Hi Stephen,
If you want to sum/average down a column or across a row you can use sum().
The optional axis={0,1} parameter determines whether you are summing down a
column (default or axis=0) or across a row (axis=1).
Greg
On 12/29/06, Stephen Simmons <[EMAIL PROTECTED]> wrote:
Hi,
I'm looking
Hi,
I'm looking for efficient ways to subtotal a 1-d array onto a 2-D grid. This
is more easily explained in code that words, thus:
for n in xrange(len(data)):
totals[ i[n], j[n] ] += data[n]
data comes from a series of PyTables files with ~200m rows. Each row has ~20
cols, and I use the fir