Assuming that I have a dataframe with the following values:
name start end description
0 ag 20 30 None
1 bgb 21 111 'a'
2 cdd 31 101 None
3 bgb 17 19 None
4 ag 20 22 None
5 ag 1 65 'avc'
I want to groupby name
and then get percent of number of description
which is not null
for every group name
For the example I show, I expect to see:
name percent
0 ag 33.3
1 bgb 50
2 cdd 0
How can I do it ?