Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Fix an inconvenience inquantiles() 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:
"Running five number summary for a data stream"# https://en.wikipedia.org/wiki/Five-number_summaryfrom statistics import quantilesimport randomstream = (random.expovariate() for i in range(20))data = []for x in stream: data.append(x) print(min(data), quantiles(data), max(data))