df = df.groupby('user')['value'].apply(lambda x: pd.Series(x.values)).unstack()
df.columns = df.columns + 1
print(df)
Groupby and reshape long to wide formatted dataframe while aggregating elements as arrays