Skip to content
Advertisement

How to get a string from column names and melt multiple columns in python?

I have this table and I need to melt away this table to be like the expected table where I need to get the point name (a and b) from the column name and let the bq and progress columns melt.

JavaScript

The expected result is as below:

JavaScript

How can do it in python?

Advertisement

Answer

Try this:

JavaScript

enter image description here

JavaScript

Result :

enter image description here

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement