I have a pandas column Reason
with 89 entries, consisting of a,b,c,d,e
. I'm trying to find the % occurrence of each Reason.
Now, I'm doing np.sum(df.eval('Reason == "a"').groupby(keys).sum())*(100/89)
for each Reason
separately. Is there a faster way?