Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

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] [-f INPUT_FILE] -n NUM

Reservoir sample tool.

optional arguments:
-h, --help show this help message 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.

Release History

This version
History Node


History Node


History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(4.7 kB) Copy SHA256 Hash SHA256
Source None Mar 16, 2018

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers