I have a DataFrame ave_data
that contains the following:
ave_data
Time F7 F8 F9
00:00:00 43.005593 -56.509746
In common case if you would like to use specific columns, you can use:
df['average'] = df[['F7','F8']].mean(axis=1)
where axis=1 stands for rowwise action (using column values for each row to calculate the mean in 'average' column)
Then you may want to sort by this column:
df.sort_values(by='average',ascending=False, inplace=True)
where inplace=True stands for applying action to dataframe instead of calculating on the copy.