Transforming Pandas dataframe
You can use the pivot
function:
df.pivot(index='date', columns='variable', values='value')
For more info see: http://pandas.pydata.org/pandas-docs/stable/reshaping.html
You can use the pivot
function:
df.pivot(index='date', columns='variable', values='value')
For more info see: http://pandas.pydata.org/pandas-docs/stable/reshaping.html