I have the following dataframe:
Date Rez ID
2023-07-03 5.95 1
2023-07-03 49.9 3
2023-07-03 33.17 54
2022-11-17 5.38 1
2022-11-17 44.4 3
2022-09-02 23.39 54
2022-09-02 5.6 1
2022-09-02 46.5 3
2021-10-19 5.34 1
2021-10-19 44.6 3
2020-12-11 5.38 1
2020-12-11 44 3
2019-04-25 5.84 1
2019-04-25 1.7 205
And would like to obtain something like this (with "ID" values as the columns and "Date" as the index)
1 3 54 205
Date
2023-07-03 5.95 49.9 33.17 NaN
2022-11-17 5.38 44.4 NaN NaN
2022-09-02 5.6 46.5 23.39 NaN
2021-10-19 5.34 44.6 NaN NaN
2020-12-11 5.38 44 NaN NaN
2019-04-25 5.84 NaN NaN 1.7
I tried the following, but I don't know how to go further (i don't get what I need):
df_sample.groupby(['ID','Date'])['Rez'].unique().to_frame().transpose()