rigt now I'm having this list of Interval
test = ['(0.556, 1.389]', '(0.192, 0.386]', '(0.386, 0.556]', '(-0.759, -0.401]', '(-0.401, -0.064]', '(-0.064, 0.192]', '(-1.34, -0.759]']
I want to sort them into the correct order, I have tried these code:
test.sort()
sorted(test, key=lambda l:l[0])
However the results are not correct:
test = ['(-0.064, 0.192]', '(-0.401, -0.064]', '(-0.759, -0.401]', '(-1.34, -0.759]', '(0.192, 0.386]', '(0.386, 0.556]', '(0.556, 1.389]']
I just to to have a list that are sorted in order, like this:
test = ['(-1.34, -0.759]', '(-0.759, -0.401]', '(-0.401, -0.064]', '(-0.064, 0.192]', '(0.192, 0.386]', '(0.386, 0.556]', '(0.556, 1.389]']