Kudos to wmin for the logic of his solution (accepted answer) which is great. So for completeness, a similar answer to this but based on numpy, which is significantly faster for anything else other than small lists/arrays, is as follows:
lst = [1, -2, 10, -12, -4, -5, 9, 2]ar = np.array(lst)ar.sort()i = ar.__abs__().argmin()np.concatenate((ar[i:], ar[:i]))