'how to unpivot table in python?

How would you unpivot the table below so that my dataframe (df) becomes the new_df?

ID     Date_x     Score_x    Date_y     Score_y    Date_z   Score_z
111    1/1/2022     70       2/1/2022     40      3/1/2022    10
ID    Date      Score
111   1/1/2022   70
111   2/1/2022   40
111   3/1/2022   10

Screenshot

I've tried pivot, unpivot, melt but I can't get to the right format that I want to :(



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source