1 import pandas as pd2 3 data = pd.read_excel("dataProcess.xlsx")4 5 dReverse = pd.melt(data,id_vars=["catalogA","catalogB"],value_vars=["2000 [YR2000]","2001 [YR2001]"])6 dReverse.to_csv("test.csv")
本文共 252 字,大约阅读时间需要 1 分钟。
1 import pandas as pd2 3 data = pd.read_excel("dataProcess.xlsx")4 5 dReverse = pd.melt(data,id_vars=["catalogA","catalogB"],value_vars=["2000 [YR2000]","2001 [YR2001]"])6 dReverse.to_csv("test.csv")
转载于:https://www.cnblogs.com/250apples/p/5795650.html