I was trying to undestand how sort_index works in pandas. I ma quite confused with the results I got when i tested with two dataframes.
I have df1 sorted with index 'pid'
df1:
pid,day,score1,score2
100,Fri,200,108
......
221,Wed,546,789
221,Sat,123,456
The second data frame sorted with index 'pid'
df2:
pid,day,score1,score2
100,Fri,230,18
......
221,Sat,563,324
221,Wed,111,789
I couldn't understand why PID# 221 is sorted differently in both cases. Ideally both should follow same sorting as i am sorting by index.
Any help on this is highly appreciated.