Skip to main content

Memory-efficient probabilistic counter namely Morris Counter

Project description

Morris Counter pyversion latest version license

Memory-efficient probabilistic counter namely Morris Counter. This module based on the following paper:

  • Robert Morris. Counting large numbers of events in small registers. Communications of the ACM, vol. 21, issue 10, pp. 840-842, 1978.

Currently Morris Counter supports Python 3.5 and higher.

Basic idea of Morris Counter is described as follows:


$ pip install morris_counter

While the Morris Counter works builtin modules, using third-party package (numpy and mmh3) leads to improve memory-usage and computation time.

$ pip install numpy mmh3


from morris_counter import MorrisCounter

mc = MorrisCounter(size=1000000, dtype='uint8', radix=2, seed=3282)
# => 1
# => 2
_ = [mc.increment('ZOC') for _ in range(2000)]
# => 2048


0.1.2 (2019-09-11)

  • First release

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 morris-counter, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size morris_counter-0.1.2.tar.gz (4.2 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