I have two arrays, the first one is a (n, 2) array which contains the start and the end of a selection in a data pool, the second one is the data pool.
The general idea is to use the first to extract the relevant data from the second but I don’t see how to do it cleanly with numpy.
I found the following solution, but it looks clumsy :
relevant_data = datapool[np.arange(*selection[0])]]
Any idea ?
update : The ability to nest indexing is a big plus (getting a subpart of selection).
Use
slice: