I used Metaflow to load a Dataframe. It was successfully unpickled from the artifact store, but when I try to view its index using df.index
, I get an error that says ModuleNotFoundError: No module named 'pandas.core.indexes.numeric'
. Why?
I've looked at other answers with similar error messages here and here, which say that this is caused by trying to unpickle a dataframe with older versions of Pandas. However, my error is slightly different, and it is not fixed by upgrading Pandas (pip install pandas -U
).
This issue is caused by the new Pandas 2.0.0 release breaking backwards compatibility with Pandas 1.x, although I don't see this documented in the release notes. The solution is to downgrade pandas to the 1.x series: pip install "pandas<2.0.0"