df
df.pivot(index='date', columns='variable', values='value')
df['value2'] = df['value'] * 2 df
pivoted = df.pivot(index='date', columns='variable') pivoted
pivoted['value']