This is a minimalistic
`Count-min Sketch <http://en.wikipedia.org/wiki/Count%E2%80%93min_sketch>`_
for Python, featuring some cool things like:
- Being able to count anything that is hash-able by python (numbers, strings, tuples, inmutables, duck-typeds, etc.).
- No dependencies
- No foreign languages, just 100% python.
This software was written by Rafael Carrascosa, you can contact me at
rafacarrascosa on gmail.
.. code-block:: python
from countminsketch import CountMinSketch
sketch = CountMinSketch(1000, 10) # table size=1000, hash functions=10
print sketch["oh yeah"] # prints 1
print sketch[tuple()] # prints 1
print sketch # prints 123
print sketch["non-existent"] # prints 0
CountMinSketch is on PyPI, so you can install it with
pip install countminsketch
BSD 3-clause, see the LICENSE file.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.