# tdigest
### Efficient percentile estimation of streaming or distributed data
[](https://pypi.python.org/pypi/tdigest/)
This is a Python implementation of Ted Dunning's [t-digest](https://github.com/tdunning/t-digest) data structure. The t-digest data structure is designed around computing accurate estimates from either streaming data, or distributed data. These estimates are percentiles, quantiles, trimmed means, etc. Two t-digests can be added, making the data structure ideal for map-reduce settings, and can be serialized into much less than 10kB (instead of storing the entire list of data).
See a blog post about it here: [Percentile and Quantile Estimation of Big Data: The t-Digest](http://dataorigami.net/blogs/napkin-folding/19055451-percentile-and-quantile-estimation-of-big-data-the-t-digest)
### Installation
```
pip install tdigest
```
### Usage
```
from tdigest import TDigest
from numpy.random import random
T1 = TDigest()
for _ in range(5000):
T1.update(random())
print T1.percentile(0.15) # about 0.15
T2 = TDigest()
T2.batch_update(random(5000))
print T2.percentile(0.15)
T = T1 + T2
T.percentile(0.3) # about 0.3
```
### Efficient percentile estimation of streaming or distributed data
[](https://pypi.python.org/pypi/tdigest/)
This is a Python implementation of Ted Dunning's [t-digest](https://github.com/tdunning/t-digest) data structure. The t-digest data structure is designed around computing accurate estimates from either streaming data, or distributed data. These estimates are percentiles, quantiles, trimmed means, etc. Two t-digests can be added, making the data structure ideal for map-reduce settings, and can be serialized into much less than 10kB (instead of storing the entire list of data).
See a blog post about it here: [Percentile and Quantile Estimation of Big Data: The t-Digest](http://dataorigami.net/blogs/napkin-folding/19055451-percentile-and-quantile-estimation-of-big-data-the-t-digest)
### Installation
```
pip install tdigest
```
### Usage
```
from tdigest import TDigest
from numpy.random import random
T1 = TDigest()
for _ in range(5000):
T1.update(random())
print T1.percentile(0.15) # about 0.15
T2 = TDigest()
T2.batch_update(random(5000))
print T2.percentile(0.15)
T = T1 + T2
T.percentile(0.3) # about 0.3
```
Metadata
Release files for tdigest 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tdigest-0.1.1.tar.gz | 4.2 kB | Details |
Release files / tdigest-0.1.1.tar.gz
| Download URL | tdigest-0.1.1.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87cf1636ea31b7d015a2aeeffc1d24b31ea92a7c7db9840559f13ec0c8a789b1
|
|
BLAKE2b-256 checksum How to use checksums |
6dff99649b1cad439f80dbb6bfe0cfc9fa16df06d839efba26f58447d13c9404
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |