axis_sort optionally returns the sorting index