Say you have a list [1,2,3,...,99,100]
import numpy as np
ls = np.linspace(1,100,100)
Say you fiddle around with the slice notation to find ones that works for you.
print(ls[:2])
>> [ 1. 2.]
print(ls[::2])
>> [ 1. 3. 5. 7. ... 97. 99.]
How can I slice the data in such a way that I can get
[1,2],[3,4],[5,6],[7,8],...,[99,100]
##
perhaps not important but my purpose is to adapt this to my dataset, where the values in the lists denote the numerical subscript of another list of values (other_values[index]) that are to be compared. Is it possible to combine slicing with arrays?