barrust/pyprobables

How to cPickle count min sketch instance

huuthonguyen76 opened this issue · 3 comments

I encounter this error when using cPickle to save count min sketch instance:

Traceback (most recent call last): File "test.py", line 14, in <module> pkl.dump(cms, f) File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy_reg.py", line 77, in _reduce_ex raise TypeError("a class that defines __slots__ without " TypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled

Is there a reason you want to use pickel? pyprobables provides an export method for every data structure. The export functionality for the count-min-sketch can be seen in here

If there is a specific reason for pickling, I would gladly except pull requests!

Thanks @barrust . This is what I'm looking for.

No problem!