1In [48]: cols = list('abc')
2
3In [49]: df = DataFrame(randn(10, len(cols)), columns=cols)
4
5In [50]: df.a.quantile(0.95)
6Out[50]: 1.5776961953820687
7
1import pandas as pd
2import random
3
4A = [ random.randint(0,100) for i in range(10) ]
5B = [ random.randint(0,100) for i in range(10) ]
6
7df = pd.DataFrame({ 'field_A': A, 'field_B': B })
8df
9# field_A field_B
10# 0 90 72
11# 1 63 84
12# 2 11 74
13# 3 61 66
14# 4 78 80
15# 5 67 75
16# 6 89 47
17# 7 12 22
18# 8 43 5
19# 9 30 64
20
21df.field_A.mean() # Same as df['field_A'].mean()
22# 54.399999999999999
23
24df.field_A.median()
25# 62.0
26
27# You can call `quantile(i)` to get the i'th quantile,
28# where `i` should be a fractional number.
29
30df.field_A.quantile(0.1) # 10th percentile
31# 11.9
32
33df.field_A.quantile(0.5) # same as median
34# 62.0
35
36df.field_A.quantile(0.9) # 90th percentile
37# 89.10000000000001