since previously the code:
def read_pickle_packet(self, sf):
body = self._read_payload(sf)
return pickle.load(body)
has an error:ImportError: No module named indexes.base. which was caused by the pandas version inconsistent between server and client. I solve the problem by changing the code like this:
def read_pickle_packet(self, sf):
body = self._read_payload(sf)
filehandler = open("tempFile.pkl", 'w')
filehandler.write(body)
filehandler.close()
return pd.read_pickle("tempFile.pkl")
It can solve the problem.
But my question is there any more quick way to load the pickle object rather than store it into filesystem and then read it. It cost time and memory.But i could not found some clue by google "pandas read pickle from object".
Thank you for any suggestion.