pandas: how to get the percentage for each row
<p>When I use pandas <code>value_count</code> method, I get the data below:</p>

<pre><code>new_df['mark'].value_counts()

1   1349110
2   1606640
3   175629
4   790062
5   330978
</code></pre>

<p>How can I get the percentage for each row like this?</p>

<pre><code>1   1349110 31.7%
2   1606640 37.8%
3   175629  4.1%
4   790062  18.6%
5   330978  7.8%
</code></pre>

<p>I need to divide each row by the sum of these data.</p>

<pre><code>np.random.seed([3,1415])
s = pd.Series(np.random.choice(list('ABCDEFGHIJ'), 1000, p=np.arange(1, 11) / 55.))

s.value_counts()

I    176
J    167
H    136
F    128
G    111
E     85
D     83
C     52
B     38
A     24
dtype: int64
</code></pre>

<hr>

<p>As percent</p>

<pre><code>s.value_counts(normalize=True)

I    0.176
J    0.167
H    0.136
F    0.128
G    0.111
E    0.085
D    0.083
C    0.052
B    0.038
A    0.024
dtype: float64
</code></pre>

<hr>

<p>Per @jezreal's suggestion</p>

<pre><code>counts = s.value_counts()
percent = s.value_counts(normalize=True) \
           .mul(100).round(1).astype(str) + '%'
pd.DataFrame({'counts': counts, 'per': percent})
</code></pre>

<p><a href="http://i.stack.imgur.com/MEwx0.png" rel="nofollow"><img src="http://i.stack.imgur.com/MEwx0.png" alt="enter image description here"></a></p>

python pandas sum percentage series