I have one Dataframe1 from which I need to form new Dataframe2 as given below. Column n1 will pick the value from Status column in Dataframe1 if Dataframe1.name = A and similarly column n2 will take the value from column Status if Dataframe1.Name = B. Also, Timestamp and id will have unique values. Can anybody please help?
Input Dataframe1:
| id | Timestamp | Name | Status |
|---|---|---|---|
| 1 | 02:15:00 | A | FALSE |
| 1 | 02:15:00 | B | TRUE |
| 2 | 03:00:00 | A | TRUE |
| 2 | 03:00:00 | B | FALSE |
Output Dataframe2:
| id | Timestamp | n1 | n2 |
|---|---|---|---|
| 1 | 02:15:00 | FALSE | TRUE |
| 2 | 03:00:00 | TRUE | FALSE |