Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot retrieve dataframe in shelve

Tags:

pandas

I saved two dataframes onto a shelve database using a previous Pandas version (unsure which one, but likely 0.25.3), and have no problems reading them from the shelve file with Pandas 0.25.3. However, I cannot read them with the latest Pandas (1.0.0, as printed by pandas.version). I get the following error:

AttributeError: Can't get attribute 'FrozenNDArray' on <module 'pandas.core.indexes.frozen' from 'local/virtualenv.../'

It seems the FrozenNDArray class has been removed in 1.0.0, so how can I recover the dataframes? Some searches point to pandas.read_pickle, but nothing equivalent for shelve.

like image 716
sluque Avatar asked Feb 03 '20 02:02

sluque


Video Answer


1 Answers

I am not sure if this is what you need, but I solved the same problem by loading my pickle file with:

pd.read_pickle(x)

where x should be your file handler.

like image 171
Biodun Solanke Avatar answered Oct 04 '22 06:10

Biodun Solanke