BUG: Unexpected behavior of sort_values
df.sort_values(by=[col])  -
If column(=col) has some values occurring multiple times then it orders them randomly. Instead, it should inherit the order in the DataFrame for the rows having same value for column.