📜  反向行顺序 pandas - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:37.357000             🧑  作者: Mango

代码示例1
import pandas as pd

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

df_col_reversed = df.loc[:, ::-1] # reverse column order
df_row_reversed = df.loc[::-1, :] # reverse row order