NumPy sort function returns None
From the documentation for numpy.ndarray.sort
:
Sort an array, in-place.
If you want a sorted copy of the original array, rather than sorting in place, you should use numpy.sort
, which returns a copy, as you saw.