Skip to main content

Python implementation of fast approximation reservioir sampling.

Project description

# os-fast-reservoir
[![Build Status](](
[![PyPI - Python Version](](

Python implementation of fast approximation reservioir sampling.

# Install
`$ pip install os-fast-reservoir`

# Usage
from os_fast_reservoir import ReservoirSampling

rs = ReservoirSampling(100)

for i in range(1000):

for i in rs:
print i
* Command line
$ os-fast-reservoir -h
usage: os-fast-reservoir [-h] [-v] [-f INPUT_FILE] -n NUM

Reservoir sample tool.

optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
file to be sampled (default: stdin)
-n NUM, --num NUM sample number

# Algorithm
* [Reservoir sampling](
* [Faster Random Samples With Gap Sampling](
* [Very Fast Reservoir Sampling](
* Another implementation: [alexprengere/reservoir](

# Unit Tests
`$ tox`

# License
MIT licensed.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for os-fast-reservoir, version 0.2.4
Filename, size File type Python version Upload date Hashes
Filename, size os-fast-reservoir-0.2.4.tar.gz (4.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page