python - reverse dataframe's rows' order with pandas -
how can reverse order of rows in pandas.dataframe?
i've looked everywhere , thing people talking sorting columns, reversing order of columns...
what want simple :
if dataframe looks this:
b c ------------------ love mat ters
i want become this:
b c ------------------ mat ters love
i know can iterate on data in reverse order that's not want.
check out http://pandas.pydata.org/pandas-docs/stable/indexing.html
you can do
reversed_df = df.iloc[::-1]
Comments
Post a Comment