📜  pandas swapaxes 示例 - Python 代码示例

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

代码示例1
import pandas as pd
df = pd.DataFrame({"A":[10, 11, 7, 8, 5], 
                   "B":[21, 5, 32, 4, 6], 
                   "C":[11, 21, 23, 7, 9], 
                   "D":[1, 5, 3, 8, 6]},  
                   index =["A1", "A2", "A3", "A4", "A5"])
dataframe.swapaxes(axis1="index", axis2="columns")