【发布时间】:2020-11-02 01:24:08
【问题描述】:
我有一个类似的问题:Reverse DataFrame Column, But Maintain the Index
反转行可以正常工作:
import pandas as pd
df = pd.DataFrame(data=[[1,2,3],[4,5,6],[7,8,9]])
df.iloc[:] = df.iloc[::-1].values
如何反转列以获得此结果
0 1 2
0 3 2 1
1 6 5 4
2 9 8 7
【问题讨论】:
标签: python pandas dataframe reverse flip