Skip to content

hashfunc to replace hashobj

Compare
Choose a tag to compare
@ekzhu ekzhu released this 06 Jan 22:25
· 92 commits to master since this release
ff34e73

Now support hashfunc parameter for MinHash and HyperLogLog. The old parameter hashobj is removed.

# Let's use MurmurHash3.
import mmh3

# We need to define a new hash function that outputs an integer that
# can be encoded in 32 bits.
def _hash_func(d):
    return mmh3.hash32(d)

# Use this function in MinHash constructor.
m = MinHash(hashfunc=_hash_func)