In order to find the index of the smallest value, I can use argmin:
argmin
import numpy as np A = np.array([1, 7, 9, 2, 0.1, 17, 17, 1.5]) print A.arg
numpy.partition(your_array, k) is an alternative. No slicing necessary as it gives the values sorted until the kth element.
numpy.partition(your_array, k)
kth