Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

reverse row order padnas

import pandas as pd

df = pd.DataFrame({'a':[1,2,3],
                   'b':[4,5,6,],
                   'c':[7,8,9,]})

df_col_reverse = df.loc[:, ::-1] # reverse column order
df_row_reverse = df.loc[::-1, :] # reverse row order
 
PREVIOUS NEXT
Tagged: #reverse #row #order #padnas
ADD COMMENT
Topic
Name
8+2 =