[Numpy-discussion] interleaved indexing

Amir amirnntp@gmail....
Fri Jul 18 03:32:17 CDT 2008

A very beginner question about indexing: let x be an array where n =
len(x). I would like to create a view y of x such that:

y[i] = x[i:i+m,...]  for each i and a fixed m << n

so I can do things like numpy.cov(y). With n large, allocating y is a
problem for me. Currently, I either do for loops in cython or
translate operations into correlate() but am hoping there is an easier
way, maybe using fancy indexing or broadcasting. Memory usage is
secondary to speed, though.


More information about the Numpy-discussion mailing list