here is something that I thought would be easier but is not (for me)...
I have some data as the one bellow:
data = pd.DataFrame({
'column1' : [0, 49, 50, 0, 100],
'column2' : [100, 0, 0, 0, 0],
'column3' : [0, 51, 50, 100, 0]
})
the output for my needs is better seen like this:
(0,100,0
49,0,51
50,0,50
0,0,100
100,0,0)
I need fix these values as none of then are zero and all rows sum to one. (column1 + column2 + column3 = 100) ex:
(1,98,1
49,1,50
49,1,50
1,1,98
98,1,1)
I thought about some function that would identify the maximum or minimum column, like np.maximum() or np.minimum() but I can't solve for the cases like row 0, row 3 or row 4... Any help would be appreciate..