'EOFError when reading pickle object (with Pandas) that's non-empty

I have a .pkl file that stores a a large pandas DataFrame on my computer; every morning a script runs that loads the file, appends new data, and re-saves it.

Today, I stopped the script shortly after it started executing to check something. When I tried to re-run it, though, it threw an error upon trying to reload the .pkl object, saying "EOFError: Ran out of input". From some cursory reading, it seems like this happens when you try to open an empty file. However, on my computer, it still shows this .pkl file isn't empty, containing 33.8 MB of data, in fact.

Does anyone know why this might be happening? Most importantly, is there any chance of recovering this DataFrame?

Thank you in advance for your help.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source