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 -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -