Pandas changing cell values based on another cell,df.sort_index(inplace=True)