How is the best way to transform the following dataframe also adding the sum of the 'status'?
Before:
plan type hour status total
A cont 0 ok 10
A cont 0 notok 3
A cont 0 other 1
A vend 1 ok 7
A vend 1 notok 2
A vend 1 other 0
B test 5 ok 20
B test 5 notok 6
B test 5 other 13
After:
plan type hour ok notok other sum
A cont 0 10 3 1 14
A vend 1 7 2 0 9
B test 5 20 6 13 39
Thanks in advance!