I have a data frame with repeating string values. I want to reorder in a desired order.
My code:
df =
name
0 Fix
1 1Ax
2 2Ax
3 2Ax
4 1Ax
5 Fix
df.sort_values(by=['name'],ignore_index=True,ascending=False))
print(df)
df =
name
0 Fix
1 Fix
2 2Ax
3 2Ax
4 1Ax
5 1Ax
Expected answer:
df =
name
0 Fix
1 Fix
2 1Ax
3 1Ax
4 2Ax
5 2Ax