pandas表格行列互换

1.导入+读取csv表格

import pandas as pd
import numpy as np

df = pd.read_csv(r"D:\xxx.csv")
print(df)

2. 转换行列 df.T

result = df.T
result.to_csv(r'xxx_Tras.csv',index=True,header=True)

你可能感兴趣的:(My,Project,pandas,python,数据分析)