I am new to pandas and I am looking for a nice way to transform this dataframe:

| Date | Name | Value |
| --- | --- | --- |
| 01-01-2022 | A | 0 |
| 01-01-2022 | B | 1 |
| 01-01-2022 | C | 1 |
| 02-01-2022 | A | 1 |
| 02-01-2022 | B | 1 |
| 02-01-2022 | C | 0 |

To this dataframe:

| Name | Value\_before | Value\_after |
| --- | --- | --- |
| A | 0 | 1 |
| B | 1 | 1 |
| C | 1 | 0 |

First table contains only data from two dates.