I have an array data which has shape (922, 6) and trgt which is a long 1d time series. data[0] has the start indexes and data[1] the end indexes of subsets that I need to slice from trgt.
I try
trgt[data[:,0:2][0]]
>>> *** IndexError: arrays used as indices must be of integer (or boolean) type
where
data[:,0:2][0]
>>> array([0., 100.])
so I try
trgt[data[:,0:2][0].astype(int)]
>>> array([9909., 9989.])
these are the VALUES at the indexes but not the subset. I try
trgt[tuple(data[:,0:2][0].astype(int))]
>>> *** IndexError: invalid index
how can I get the subset?