i have to convert below input pandas dataframe to output dataframe ( having one row per id):
input dataframe:
| id | attribute | score | date |
|---|---|---|---|
| 1 | attr1 | 20 | 13-jul-21 |
| 1 | attr2 | 30 | 23-jun-21 |
| 2 | attr2 | 12 | 24-may-21 |
| 2 | attr3 | 0 | 23-oct-21 |
output dataframe:
| id | attr1.score | attr1.date | attr2.score | attr2.date | attr3.score | attr3.date |
|---|---|---|---|---|---|---|
| 1 | 20 | 13-jul-21 | 30 | 23-jun-21 | null | null |
| 2 | null | null | 12 | 24-may-21 | 0 | 23-oct-21 |
P.S. there can be 1000's of attributes and millions of id's. i just created example with 3 attributes and 2 id's to explain the problem statement.
any suggestion would be highly appreciated, thanks :)