pandas: find percentile stats of a given column
<p>I have a pandas data frame my_df, where I can find the mean(), median(), mode() of a given column:</p>

<pre><code>my_df['field_A'].mean()
my_df['field_A'].median()
my_df['field_A'].mode()
</code></pre>

<p>I am wondering is it possible to find more detailed stats such as 90 percentile? Thanks!</p>

<p>assume series <code>s</code></p>

<pre><code>s = pd.Series(np.arange(100))
</code></pre>

<p>Get quantiles for <code>[.1, .2, .3, .4, .5, .6, .7, .8, .9]</code></p>

<pre><code>s.quantile(np.linspace(.1, 1, 9, 0))

0.1     9.9
0.2    19.8
0.3    29.7
0.4    39.6
0.5    49.5
0.6    59.4
0.7    69.3
0.8    79.2
0.9    89.1
dtype: float64
</code></pre>

<p>OR</p>

<pre><code>s.quantile(np.linspace(.1, 1, 9, 0), 'lower')

0.1     9
0.2    19
0.3    29
0.4    39
0.5    49
0.6    59
0.7    69
0.8    79
0.9    89
dtype: int32
</code></pre>

python python-2.7 pandas statistics