Skip to main content

Installation:

Use pip install hyperloglog to install from PyPI.

Usage:

import hyperloglog
hll = hyperloglog.HyperLogLog(0.01)  # accept 1% counting error
hll.add("hello")
print(len(hll))  # 1
hll.add("hello")
print(len(hll))  # 1 as items aren't added more than once
hll.add("hello again")
print(len(hll))  # 2

If we add a further 1000 random strings (giving a total of 1002 strings) we’ll have a count roughly within 1% of the true value, in this case it counts 1007 (within +/- 10.2 of the true value)

# add 1000 random 30 char strings to hll
import random
import string
[hll.add("".join([string.ascii_letters[random.randint(0, len(string.ascii_letters)-1)] for n in range(30)])) for m in range(1000)]
print(len(hll))  # 1007

Changes:

  • Added Sliding window HLL version

  • Added bias correction from HLL++

References:

  1. http://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf

  2. http://hal.archives-ouvertes.fr/docs/00/46/53/13/PDF/sliding_HyperLogLog.pdf

  3. http://research.google.com/pubs/pub40671.html

https://deepwiki.com/badge.svg

Download files

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

Source Distribution

hyperloglog-0.1.7.tar.gz (48.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hyperloglog-0.1.7-py3-none-any.whl (48.3 kB view details)

Uploaded Python 3

File details

Details for the file hyperloglog-0.1.7.tar.gz.

File metadata

  • Download URL: hyperloglog-0.1.7.tar.gz
  • Upload date:
  • Size: 48.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for hyperloglog-0.1.7.tar.gz
Algorithm Hash digest
SHA256 a70691b73ef8a5c783d3fe866e1ae0f02aa8a46c227e8a2a8bf89ca8a56ca514
MD5 6c176f7ace17afb193c7fbf31238893e
BLAKE2b-256 8846926d7841849eb7ac0059f6f6349f3274ddf87219aa47a643b53b7082801a

See more details on using hashes here.

File details

Details for the file hyperloglog-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: hyperloglog-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 48.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for hyperloglog-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 286c18e8af6bff8db21f13e5dc49d6286efb5aec4072de08de455f42c64adbca
MD5 cfe240787a6c50ce36db960012269769
BLAKE2b-256 1b1df23e84af9cd4abbb442fa6c625c5a2f22c41110cd3432b034c9cdd9c9410

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page