I Know this question has a lot of answers, for example: How to sort pandas data frame using values from several columns?
I tried the solutions given by the users, bu
If I'm understanding you correctly, you're trying to sort that df by 'retweets'? use:
maxTweets_sorted = maxTweets.sort_values(by='Retweets')
By default pandas does not sort in place, unlike Python's list
.
Change
maxTweets.sort_values(by=['Tweet', 'Retweets'], ascending=[False, True])
to
maxTweets = maxTweets.sort_values(by=['Tweet', 'Retweets'], ascending=[False, True])
or pass inplace=True
maxTweets.sort_values(by=['Tweet', 'Retweets'], ascending=[False, True], inplace=True)