I have a dataframe saved to a pickle (with a bunch of other stuff, as a dictionary). It was saved when using pandas version 1.1.5.
I'm trying to open it with version 1.0.1 but get the following error
File "<stdin>", line 1, in <module>
File "/opt/conda/lib/python3.7/site-packages/pandas/core/generic.py", line 5272, in __getattr__
if self._info_axis._can_hold_identifiers_and_holds_name(name):
File "/opt/conda/lib/python3.7/site-packages/pandas/core/generic.py", line 5272, in __getattr__
if self._info_axis._can_hold_identifiers_and_holds_name(name):
File "/opt/conda/lib/python3.7/site-packages/pandas/core/generic.py", line 5272, in __getattr__
if self._info_axis._can_hold_identifiers_and_holds_name(name):
[Previous line repeated 493 more times]
File "/opt/conda/lib/python3.7/site-packages/pandas/core/generic.py", line 493, in _info_axis
return getattr(self, self._info_axis_name)
File "/opt/conda/lib/python3.7/site-packages/pandas/core/generic.py", line 5270, in __getattr__
return object.__getattribute__(self, name)
File "pandas/_libs/properties.pyx", line 63, in pandas._libs.properties.AxisProperty.__get__
File "/opt/conda/lib/python3.7/site-packages/pandas/core/generic.py", line 5270, in __getattr__
return object.__getattribute__(self, name)
RecursionError: maximum recursion depth exceeded while calling a Python object
Is there any way to overcome this error? I can save the dataframe again, but can't downgrade or upgrade versions on both computers.
Thanks
I was unable to replicate your exact error but I was able to get another error when I tried to read a pickle file created by pandas v1.1.5 using pandas v1.0.1. I was able to workaround the issue by saving the file using the feather format. Sample code:-
Reading the file in v1.0.1:
The drawbacks with this approach are that there's an additional dependency on
pyarrowand saving in the feather binary format requires that you reset the index as I've done above.