Description
Code Sample
import pandas as pd
d = {'col1': ['a', 'b']}
df = pd.DataFrame(data=d)
df.col1 == 'interval' # works
df.col1 == 'bintervals' # works
df.col1 == 'intervals' # RecursionError
df.col1 == 'interval11111' # RecursionError
Reproduced on python 2.7.15, 3.6.7, 3.7.0, 3.7.2 on Debian (using official Docker images), can't reproduce on macOS.
Issue Description
My use case involves using a very small DataFrame from a csv, whose columns will be compared against words in news stories. Recently, I noticed some RecusionError
s in my server logs. After some digging, I discovered that comparing a DataFrame's column against a string that starts with "interval" causes the RecursionError.
The error appears to occur when the string starts with "interval" (no characters preceding it) and has additional characters after "interval". I'm not familiar enough with pandas to know why this could be happening. Are values starting with "interval" reserved for pandas' internal implementation of Intervals?
Strangely I can't reproduce the RecursionError on macOS. This issue could be related to Python on Debian, but the recursion loop does seem to originate in pandas/core/dtypes/dtypes.py
.
My apologies if this is a duplicate issue that is already being tracked. I could not find any other reports of issues with this value, or documentation that states "interval..." is a reserved value.
Stack trace of RecursionError
Expected Output
Pandas should not raise a RecursionError.
Output of pd.show_versions()
pandas: 0.24.1
pytest: 4.3.0
pip: 18.1
setuptools: 40.6.2
Cython: None
numpy: 1.16.1
scipy: None
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.8.0
pytz: 2018.9
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: None
bs4: None
html5lib: None
sqlalchemy: 1.2.18
pymysql: None
psycopg2: 2.7.7 (dt dec pq3 ext lo64)
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None