>>> pop.get_mean()
5.2
>>> round(pop.get_stdev(), 2)
- 6.99
+ 1.75
>>> pop.get_percentile(20)
3
>>> pop.get_percentile(60)
variance += (n - mean) ** 2
for n in self.highers:
variance += (n - mean) ** 2
- return math.sqrt(variance)
+ count = len(self.lowers) + len(self.highers) - 1
+ return math.sqrt(variance) / count
def get_percentile(self, n: float) -> float:
"""Returns the number at approximately pn% (i.e. the nth percentile)