-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
Description
-
I have searched the [pandas] tag on StackOverflow for similar questions.
-
I have asked my usage related question on StackOverflow.
Question about pandas
Hi Team, does the method hash_pandas_object
have circular dependencies?
I'm not able to serialize class that contains the method in my code with dill
.
# Your code here, if applicable
import numpy as np
import pandas as pd
from pandas.core.util.hashing import hash_pandas_object
# Same result using the following library
# from pandas.util import hash_pandas_object
class T:
def __init__(self):
self.dataset_hash = ""
def main(self):
df = pd.DataFrame(np.random.randint(0, 100, size=(100, 4)), columns=list('ABCD'))
print(df)
self.dataset_hash = hash_pandas_object(df).sum()
import sys
import dill
sys.setrecursionlimit(10 ** 4)
t = T()
with open("test.dill", "wb") as f:
dill.dump(t, f, recurse=True)
t.main()
NOTE:
I've opened an issue to the dill
repository to [https://github.com/uqfoundation/dill/issues/374]