2016-11-15 21 views

回答

5

您可以使用splitpivot

df[['year','month']] = df.Date.str.split('-', expand=True) 
df = df.pivot(index='month', columns='year', values='Values') 
print (df) 
year 2005 2006 
month    
01  10 40 
02  20 50 
03  30 70 
相關問題