SyntaxFix
Write A Post
Hire A Developer
Questions
I would suggest using numpy's sort, as it is anyway what pandas is doing in background:
import numpy as np np.sort(df.A.unique())
But doing all in pandas is valid as well.