Hello,
I have a simple dataframe df :
| lineage |
count |
| skin |
82 |
| kidney |
19 |
| bone |
39 |
| breast |
11 |
| peripheral_nervous_system |
17 |
| colorectal |
36 |
| ovary |
14 |
Also, for each entry in the 'lineage' column, I have a separate numeric containing a value. So I have 7 numerics (skin is 47 for example).
How can I add a column called Result which is just this simple division of one of the numerics , divided by the respective value in count (referencing df) *100.
So the result for skin would be 47/82*100 = 57.13
| lineage |
count |
Result |
| skin |
82 |
57.13 |
| kidney |
19 |
xx.xx |
| bone |
39 |
xx.xx |
| breast |
11 |
xx.xx |
| peripheral_nervous_system |
17 |
xx.xx |
| colorectal |
36 |
xx.xx |
| ovary |
14 |
xx.xx |