I have a data frame that looks like this. I have created 3 new columns that will take the value from other columns.I want function columns separate column and grab total hours for each user for each function.
User Function Total hours Damage Processing problem solve damages sweeper
schae Damage Processing 9.36
Julie Problem solve 9.70
John sweeper 18.9
Dan Damages 1.83
Dan Damages 1.83
Julie Damages 1.83
Dan Problem solve 1.83
The expected output will look like
User Function Total hours Damage Processing problem solve damages sweeper
schae Damage Processing 9.36 9.36
Julie Problem solve 9.70 9.70
John sweeper 18.9 18.9
Dan Damages 1.83 1.83
Dan sweeper 1.83 1.83
Julie Damages 1.83 1.83
Dan Problem solve 1.83 1.83
I think of pd.melt but it throws an error value var not present
res = pd.melt(result,id_vars = ['Function'],value_vars=['Total hours'])