Skill: stats
Lightweight descriptive-statistics helpers. Use this when a task needs quick summary statistics, quantiles, correlation, or z-score normalization on plain Python number lists — no pandas/numpy required.
Import
from example_stats.kernel import summary, quantile, zscore, correlation
Recipes
Describe a dataset in one call:
data = [4, 8, 15, 16, 23, 42]
s = summary(data)
print(s) # {'n':6,'mean':18.0,'std':13.49...,'min':4,'max':42,'median':15.5}
Get an arbitrary quantile (0..1):
p90 = quantile(data, 0.90)
print(p90)
Standardize values (z-scores, sample std):
z = zscore(data)
print(z) # list of z-scores, mean~0 std~1
Pearson correlation between two equal-length series:
r = correlation([1, 2, 3, 4], [2, 4, 6, 8])
print(r) # 1.0
Notes
summaryuses SAMPLE std (n-1 denominator). Passpopulation=Truefor the n-denominator version.- All functions raise
ValueErroron empty input. - Everything is pure stdlib; safe to call inside the persistent kernel.