Q:

Python: How to extract the index of the smallest value in a subset of a list?

I have a list L containing 100 values.
I wish to find the index (i.e., argmin) of this list between 20 to 100, so I write
print(np.argmin(L[20:]))

To my surprise, it printed out 0, instead of something that is equal or greater than 20. 
What am I doing wrong?

A:

argmin will return the index of the smallest element of the array passed; however, because this array starts at 20, you will need to add that starting point of your sublist, to obtain the index of the same smallest element in the original array:
start = 20
print(np.argmin(L[start:]) + start)

