Is there a way to get the index of the median in python in one command? September 10, 2023 by Tarik a quick approximation: numpy.argsort(data)[len(data)//2]