I have a following code of snippet.
df = pd.DataFrame({'col1' : ['A', 'A', 'B', np.nan, 'D', 'C'],
'col2' : [2, 1, 9, 8, 7, 4],
'col3': [0, 1, 9, 4, 2, 3]})
print(df)
sorted=df.sort_values(by=1,axis=1)
print(sorted)
The above data is original dataframe .
The above one is output of the df.sort_values() function.
Can anyone explain what is happening here?