<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def kdists(matrix, k=7, ix=None):
 """ Returns the k-th nearest distances, row-wise, as a column vector """


    ix = ix or kindex(matrix, k)
    return matrix[ix][np.newaxis].T