df.sort_values(['Total Due'])
returns a sorted DF, but it doesn’t update DF in place.
So do it explicitly:
df = df.sort_values(['Total Due'])
or
df.sort_values(['Total Due'], inplace=True)
NOTE: the Pandas core team discourages the use of inplace=True
parameter because it should be deprecated in the future versions of Pandas.