-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
RecursionError when selecting single column from IntervalIndex #26490
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
Comments
Thanks, I can confirm this issue on master. Using an |
This worked in pandas 0.23.4. My impression is that we can at least get back to the old behaviour without breaking anything by changing Line 2840 in ae40904
to if self.columns.is_unique and self.columns.contains(key): but I'm unsure whether I miss some side-effects of this change for other index types. This change will prevent the |
Using the Additionally, IIRC there were talks of deprecating the A simple fix looks to be converting Lines 2889 to 2890 in b730ab3
|
…26490 (#37152) * split off of 37150 * Troubleshoot Co-authored-by: Jeff Reback <[email protected]>
…andas-dev#26490 (pandas-dev#37152) * split off of 37150 * Troubleshoot Co-authored-by: Jeff Reback <[email protected]>
…andas-dev#26490 (pandas-dev#37152) * split off of 37150 * Troubleshoot Co-authored-by: Jeff Reback <[email protected]>
Code Sample, a copy-pastable example if possible
Problem description
Instead of returning the selected column, either calling
df[0.5]
ordf.loc[:, 0.5]
raisesRecursionError
.The issue is in
frame.__getitem__
wherekey in self.columns == False
. The code then correctly identifies the desired column by integer index usingself.columns.get_loc(key)
, but then goes on to callBecause
self._take
returns a DataFrame,data[key]
entersframe.__getitem__
again and we are caught in an infinite loop.Expected Output
The selected column as Series.
Output of
pd.show_versions()
commit: None
python: 3.6.8.final.0
python-bits: 64
OS: Windows
OS-release: 7
machine: AMD64
processor: Intel64 Family 6 Model 42 Stepping 7, GenuineIntel
byteorder: little
LC_ALL: None
LANG: en
LOCALE: None.None
pandas: 0.24.2
pytest: 4.3.1
pip: 19.0.3
setuptools: 40.8.0
Cython: 0.29.7
numpy: 1.16.2
scipy: 1.2.1
pyarrow: None
xarray: None
IPython: 7.4.0
sphinx: 1.8.5
patsy: 0.5.1
dateutil: 2.8.0
pytz: 2018.9
blosc: None
bottleneck: None
tables: 3.5.1
numexpr: 2.6.9
feather: None
matplotlib: 3.0.3
openpyxl: 2.6.1
xlrd: 1.2.0
xlwt: None
xlsxwriter: None
lxml.etree: None
bs4: None
html5lib: None
sqlalchemy: 1.3.1
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: