I am making a site that will allow you to tweet other's messages. Each message will have its tweets in a csv file. I will loop through the csv file, finding all the tweets for the given message and arranging them into a list.
The thing is, when I loop throught the data, the oldest tweets (the ones at the very start of the file) would appear first in the list. Is there a way to either loop through the pandas DataFrame from bottom to top, or when appending the tweets append them to the very start of the file? Here is my code:
current_message_name = 'Draft Message' # This is the name of the message the user is veiwing right now.
tweets = []
df = pd.read_csv('data/tweets.csv')
for index, row in df.iterrows():
tweets.append({
'poster':f'{row["poster"]}',
'date':f'{row["date"]}',
'message':f'{row["message"]}',
})