Sankey Diagram Data Preprocessing - Python

I hope you did the right approach. I’am dealing with a similar challange now (5000 rows x 10 cols data frame) and it’s definitely not a piece of cake.
Best!