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

BUG: fillna maximum recursion depth exceeded in cmp #18159

llchan opened this Issue Nov 8, 2017 · 1 comment


None yet
2 participants

llchan commented Nov 8, 2017

Code Sample, a copy-pastable example if possible

import pandas as pd
import numpy as np

s = pd.Series([float('nan')])
t = s.fillna(2 ** 63)         # RuntimeError: maximum recursion depth exceeded in cmp
t = s.fillna(float(2 ** 63))  # works

Problem description

A fillna call with a large integer causes infinite recursion. Converting to a float before passing it in seems to fix it. Maybe the arg of fillna should be converted to the series dtype immediately?

Note that this bug only affects PY2, PY3 works just fine.

Output of pd.show_versions()


commit: None
python-bits: 64
OS: Linux
OS-release: 3.x.x...x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LOCALE: None.None

pandas: 0.21.0
pytest: 3.2.3
pip: 9.0.1
setuptools: 36.6.0
Cython: 0.27.3
numpy: 1.13.3
scipy: 1.0.0
pyarrow: None
xarray: None
IPython: 5.4.1
sphinx: None
patsy: 0.4.1
dateutil: 2.6.1
pytz: 2017.3
blosc: None
bottleneck: None
tables: 3.4.2
numexpr: 2.6.4
feather: None
matplotlib: 2.1.0
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: 0.999999999
sqlalchemy: 1.1.15
pymysql: None
psycopg2: (dt dec pq3 ext)
jinja2: 2.9.6
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: 0.5.0


This comment has been minimized.

Show comment
Hide comment

jreback Nov 8, 2017


seems like a bug - if you could trace would be great


jreback commented Nov 8, 2017

seems like a bug - if you could trace would be great

@jreback jreback added this to the Next Major Release milestone Nov 8, 2017

@jreback jreback added the Bug label Nov 8, 2017

@jreback jreback modified the milestones: Next Major Release, 0.21.1, 0.22.0 Dec 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment