Using Python and Pandas I have a dataframe that is filled with numerical values. What I am trying to do, and can't figure out is how do I return a new data frame where each number represents a percentage of that row
Essentially what I need is to return a new data frame where the numbers from the old data frame are changed to represent the % they represent of that specific row as a whole. Hope that makes sense.
Below is an example of the starting data frame, each row would total 10 to make the example easy and simple
ambivalent negative neutral positive
11/15/2021 6 2 1 1
11/8/2021 4 1 2 3
what I want to achieve is this
ambivalent negative neutral positive
11/15/2021 60% 20% 10% 10%
11/8/2021 40% 10% 20% 30%
I don't need the actual % symbol just the actual percent numbers will work.
Can someone point me in the right direction in how to do this?