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

Pierre GM pgmdevlist at gmail.com
Fri Jan 30 13:44:46 EST 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