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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

ios - MKMapView fails to load tiles with HTTP 410 error -

c# - How to utilize EF and LINQ to add filters and specify tables, columns, filters and order by dynamically -