Identifying Correct String Order in Pandas I have a dataframe as the following, showing the relationship of different entities in each row.