Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

RecursionError when using pandas 1.5.1 #2

Open
pynomaly opened this issue Nov 14, 2022 · 0 comments
Open

RecursionError when using pandas 1.5.1 #2

pynomaly opened this issue Nov 14, 2022 · 0 comments
Assignees
Labels
question Further information is requested

Comments

@pynomaly
Copy link
Contributor

There is a bug in pandas 1.5.1 and we get this error message when using ictiopy.load_zipdb():

RecursionError: maximum recursion depth exceeded while calling a Python object

The error is due to this line:

bdb = bdb.replace(np.nan, None, regex=True)

The bug is documented here: pandas-dev/pandas#45725

The bug is closed and will be fixed for pandas version 1.5.2. In the meanwhile, they recommend to use pandas 1.4.7.

Other methods are working to replace np.nan by None, like this:

bdb_data = bdb_data.astype(object).replace(np.nan, 'None')

This and others are pointed here: https://stackoverflow.com/questions/14162723/replacing-pandas-or-numpy-nan-with-a-none-to-use-with-mysqldb

If you prefer to keep the code as it is right now I can add a pandas != 1.5.0, 1.5.1 in the requirements of mecoda-orange.

@pynomaly pynomaly added the question Further information is requested label Nov 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants