In [4]:
import pandas as pd
In [5]:
df = pd.DataFrame({"x": [1, 2, 3, 4, 5], "a": [5, 4, 3, 2, 1]})
df.head()
Out[5]:
In [8]:
df.sort_values("a")
Out[8]:
In [24]:
a = pd.DataFrame({"x": [1, 2, 3, 4, 5], "y": [5, 4, 3, 2, 1]})
a.head()
Out[24]:
In [25]:
a.sort_values("y", inplace=True)
a
Out[25]:
In [ ]: