<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def kindex(matrix, k):
 """ Returns indices to select the kth nearest neighbour"""


    ix = (np.arange(len(matrix)), matrix.argsort(axis=0)[k])
    return ix