there are similar questions existing, however cant find the right answer. Most of them require a common nominator which I don't have.
I want to have two outcomes from two data frames.
One is to get the percentage for each row in df2 from the total (df1). And another view of accumulated percentage.
df1
a
1875
df2
b c
aaa 125
bbb 250
ccc 500
ddd 1000
Required outcome.
b c Outcome 1 Outcome 2
aaa 125 6.67% 100.00%
bbb 250 13.33% 93.33%
ccc 500 26.67% 80.00%
ddd 1000 53.33% 53.33%
I have tried df1.eq(df2.values).mean() and couple of the merge functions. But again, don't have a common nominator.
Hope this helps. Thanks.