I am looking to pivot the feature column into column headers.
here is the df
for instance neither of the below work. I've tried multiple variations to no avail.
df.groupby(['feature', 'year'])['value'].unstack(fill_value=0)
df.pivot_table(index='year', columns='feature', values='value')
The end goal would look like this.