Currently I have a dataframe that looks somewhat like this:
| movieId | userId | rating |
|---|---|---|
| 1 | 1 | 2.5 |
| 1 | 2 | 4 |
| 1 | 4 | 3 |
Is there a way in python that could make it look like this:
| movieId | userId_1 | userId_2 | userId_3 | userId_4 |
|---|---|---|---|---|
| 1 | 2.5 | 4 | 0 | 3 |
And that movieId could become the unique key in my dataframe?