Percentiles

Percentiles

In [6]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
In [7]:
avg = 0
stdDev = 0.5
numberOfPoints = 10000

vals = np.random.normal(avg, stdDev, numberOfPoints)

plt.hist(vals, 50)
plt.show()
output png
In [8]:
np.percentile(vals, 50)
Out [8]:
-0.0030719360590375777
In [9]:
np.percentile(vals, 90)
Out [9]:
0.6307480671126598
In [10]:
np.percentile(vals, 20)
Out [10]:
-0.4086898550977171
Page Tags:
python
data-science
jupyter
learning
numpy