Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pandas compatibility issue (No module named 'pandas.core.indexes.numeric') #610

Closed
xerxes-k opened this issue Aug 10, 2023 · 4 comments
Closed
Labels
Milestone

Comments

@xerxes-k
Copy link

xerxes-k commented Aug 10, 2023

class Unpickler(StockUnpickler):
    """python's Unpickler extended to interpreter sessions and more types"""
    from .settings import settings
    _session = False

    def find_class(self, module, name):
        if (module, name) == ('__builtin__', '__main__'):
            return self._main.__dict__ #XXX: above set w/save_module_dict
        elif (module, name) == ('__builtin__', 'NoneType'):
            return type(None) #XXX: special case: NoneType missing
        if module == 'dill.dill': module = 'dill._dill'
        return StockUnpickler.find_class(self, module, name)

with pandas Version: 2.0.1, when using dill to load data, above code runs into moduleNotFound error

@mmckerns
Copy link
Member

mmckerns commented Aug 11, 2023

Can you give a minimal self-contained example of code that throws this error?
Also, what version of dill and what version of python and what OS did you test with?

@mmckerns
Copy link
Member

I'm not experiencing an issue with a simple test:

Python 3.8.17 (default, Jun 11 2023, 01:54:00) 
[Clang 13.1.6 (clang-1316.0.21.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> import dill
>>> d = pd.DataFrame(dict(a=pd.Series(dict(q=2,w=3)), b=pd.Series(dict(q=4,t=5))))
>>> s = dill.loads(dill.dumps(d))
>>> s
     a    b
q  2.0  4.0
t  NaN  5.0
w  3.0  NaN
>>> 
>>> dill.__version__
'0.3.8.dev0'
>>> pd.__version__
'1.5.3'

Of course, you can see my pandas version is 1.5.3...
Can you give an example like this that triggers the error?

@mmckerns
Copy link
Member

Also, was the same version of dill and/or pandas and/or python used to save and to load the data?

@xerxes-k
Copy link
Author

Also, was the same version of dill and/or pandas and/or python used to save and to load the data?

i believe this is the issue

the error happened when opening a file saved in colab. found out colab and my laptop have different versions of pandas

@mmckerns mmckerns added this to the dill-0.3.8 milestone Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants