We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
import pandas as pd import numpy as np pd.DataFrame({'A': [np.NaN]}).replace(np.NaN, None) > RecursionError: maximum recursion depth exceeded while calling a Python object
This was working in an earlier versoin of pandas, but not in 1.5.1 any more.
The np.NaNs should be replaced with None in the current dataframe.
np.NaN
None
commit : 91111fd python : 3.9.15.final.0 python-bits : 64 OS : Linux OS-release : 5.4.0-135-generic Version : #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022 machine : x86_64 processor : x86_64 byteorder : little LC_ALL : None LANG : en_US.UTF-8 LOCALE : en_US.UTF-8
pandas : 1.5.1 numpy : 1.21.5 pytz : 2022.1 dateutil : 2.8.2 setuptools : 65.5.0 pip : 22.2.2 Cython : None pytest : 6.2.5 hypothesis : None sphinx : None blosc : None feather : None xlsxwriter : 3.0.2 lxml.etree : 4.6.4 html5lib : None pymysql : None psycopg2 : 2.9.5 jinja2 : 3.0.3 IPython : 8.6.0 pandas_datareader: None bs4 : 4.10.0 bottleneck : 1.3.5 brotli : fastparquet : 0.7.1 fsspec : 2021.11.0 gcsfs : None matplotlib : 3.6.1 numba : 0.55.1 numexpr : 2.8.3 odfpy : None openpyxl : 3.0.9 pandas_gbq : None pyarrow : 6.0.0 pyreadstat : None pyxlsb : None s3fs : None scipy : 1.6.2 snappy : None sqlalchemy : 1.4.27 tables : 3.6.1 tabulate : 0.8.9 xarray : None xlrd : 2.0.1 xlwt : None zstandard : None tzdata : None
The text was updated successfully, but these errors were encountered:
I believe this is fixed if you install 1.5.2 https://pandas.pydata.org/docs/dev/whatsnew/v1.5.2.html
Sorry, something went wrong.
Confirmed. For some reason my conda update pandas did not update pandas accordingly. Thanks
conda update pandas
No branches or pull requests
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
This was working in an earlier versoin of pandas, but not in 1.5.1 any more.
Expected Behavior
The
np.NaN
s should be replaced withNone
in the current dataframe.Installed Versions
INSTALLED VERSIONS
commit : 91111fd
python : 3.9.15.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.0-135-generic
Version : #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.5.1
numpy : 1.21.5
pytz : 2022.1
dateutil : 2.8.2
setuptools : 65.5.0
pip : 22.2.2
Cython : None
pytest : 6.2.5
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 3.0.2
lxml.etree : 4.6.4
html5lib : None
pymysql : None
psycopg2 : 2.9.5
jinja2 : 3.0.3
IPython : 8.6.0
pandas_datareader: None
bs4 : 4.10.0
bottleneck : 1.3.5
brotli :
fastparquet : 0.7.1
fsspec : 2021.11.0
gcsfs : None
matplotlib : 3.6.1
numba : 0.55.1
numexpr : 2.8.3
odfpy : None
openpyxl : 3.0.9
pandas_gbq : None
pyarrow : 6.0.0
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.6.2
snappy : None
sqlalchemy : 1.4.27
tables : 3.6.1
tabulate : 0.8.9
xarray : None
xlrd : 2.0.1
xlwt : None
zstandard : None
tzdata : None
The text was updated successfully, but these errors were encountered: