I know how to iterate through the rows of a pandas DataFrame:
for id, value in df.iterrows():
but now I'd like to go through the rows in reverse order (id
is numeric, but doesn't coincide with row number). Firstly I thought of doing a sort on index data.sort(ascending = False)
and then running the same iteration procedure, but it didn't work (it seem to still go from smaller id
to larger).
How can I accomplish this?