How to sort one column based on another in python. So the first column is a list type.