Merge the other MinHash with this one, making this one the union of both. Args: other (datasketch.MinHash): The other MinHash.
(self, other)
| 204 | return float(k) / np.sum(self.hashvalues / float(_max_hash)) - 1.0 |
| 205 | |
| 206 | def merge(self, other): |
| 207 | '''Merge the other MinHash with this one, making this one the union |
| 208 | of both. |
| 209 | |
| 210 | Args: |
| 211 | other (datasketch.MinHash): The other MinHash. |
| 212 | ''' |
| 213 | if other.seed != self.seed: |
| 214 | raise ValueError("Cannot merge MinHash with\ |
| 215 | different seeds") |
| 216 | if len(self) != len(other): |
| 217 | raise ValueError("Cannot merge MinHash with\ |
| 218 | different numbers of permutation functions") |
| 219 | self.hashvalues = np.minimum(other.hashvalues, self.hashvalues) |
| 220 | |
| 221 | def digest(self): |
| 222 | '''Export the hash values, which is the internal state of the |