Pandas - Get value as frequency in groupby
<p>Can someone help me with the (possible) groupby in pandas.</p>

<p>Here is the df:</p>

<pre><code>    easy_donor  v_fam   count
0   donor_1_NS  IGHV1   5202376
1   donor_1_NS  IGHV2   1955547
2   donor_1_NS  IGHV3   70426272
3   donor_1_NS  IGHV4   452367
4   donor_1_NS  IGHV5   4842145
5   donor_1_NS  IGHV6   490142
6   donor_1_NS  IGHV7   19708
24  donor_2_NS  IGHV1   31258603
25  donor_2_NS  IGHV2   5295899
26  donor_2_NS  IGHV3   47286417
27  donor_2_NS  IGHV4   44553802
</code></pre>

<p>Then I want each count as a frequency of the sum of the counts grouped by donor.</p>

<p>Like:</p>

<pre><code>df.groupby('easy_donor').sum()['count']
easy_donor
donor_1_NS     83394639
donor_2_NS    129191591
donor_3_HS    220549762
donor_3_NS    104821016
donor_4_HS    200444923
donor_4_NS    121287306
</code></pre>

<p>Then each count in the original data frame divided by the groupby sum if they match the easy_donor column. Do I have to join on original dataframe?</p>