I am using pandas dataframe (python), it is currently in this format:
I am trying to convert the above dataframe into a new dataframe in below format:
I am trying to avoid doing this using a lot of code as performance will be impacted, is there some dataframe function that can be used to achieve this?