[Numpy-discussion] puzzle: generate index with many ranges

Pierre GM pgmdevlist@gmail....
Fri Jan 30 12:44:46 CST 2009


On Jan 30, 2009, at 1:11 PM, Raik Gruenberg wrote:

>
> Mhm, I got this far. But how do I get from here to a single index  
> array
>
> [ 4, 5, 6, ... 10, 0, 1, 2, 3, 11, 12, 13, 14 ] ?

np.concatenate([np.arange(aa,bb) for (aa,bb) in zip(a,b)])


More information about the Numpy-discussion mailing list