You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix an inconvenience in quantiles() by supporting input lists of length one, much like min(), max(), mean() and median() also support datasets of size one.
The principal use case is making statistical summaries of data streams. It is really inconvenient to require a special case for the first data point. Instead, it is much nicer to make updates as new data arrives, starting with the very first datum.
This is what we want:
"Running five number summary for a data stream"
# https://en.wikipedia.org/wiki/Five-number_summary
from statistics import quantiles
import random
stream = (random.expovariate() for i in range(20))
data = []
for x in stream:
data.append(x)
print(min(data), quantiles(data), max(data))
Fix an inconvenience in
quantiles()
by supporting input lists of length one, much likemin()
,max()
,mean()
andmedian()
also support datasets of size one.The principal use case is making statistical summaries of data streams. It is really inconvenient to require a special case for the first data point. Instead, it is much nicer to make updates as new data arrives, starting with the very first datum.
This is what we want:
Linked PRs
The text was updated successfully, but these errors were encountered: