Using : For Multiple Slicing In List Or Numpy Array
I'm having some difficulty trying to figure out how to do extract multiple values in a list that are spaced some indices apart. For example, given a list l = [0,1,2,3,4,5,6,7,8,9,1
Solution 1:
I think you need numpy.r_
for concanecate indices:
print (np.r_[1:4, 6:10])
[1 2 3 6 7 8 9]
Post a Comment for "Using : For Multiple Slicing In List Or Numpy Array"