import pandas as pd if __name__ == '__main__': pd.options.display.max_columns = 999 Videos = pd.read_excel("C:/Users/18124/Desktop/pandas/021_旋转数据表/Videos.xlsx", engine="openpyxl", index_col="Month") print(Videos) # 旋转表 table = Videos.transpose() print(table)