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
>>> import pandas as pd >>> pd.IntervalIndex.from_tuples([(1,100)]).get_loc(50) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/imre/code/pandas/pandas/core/indexes/interval.py", line 1049, in get_loc raise KeyError(original_key) KeyError: 50
50 is contained in the interval (1, 100), so this should not raise KeyError.
KeyError
0
pd.show_versions()
commit: c4da79b python: 3.6.3.final.0 python-bits: 64 OS: Linux OS-release: 4.13.0-39-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: en_US.UTF-8 LOCALE: en_US.UTF-8
pandas: 0.23.0.dev0+824.gc4da79b5b pytest: None pip: 10.0.1 setuptools: 39.1.0 Cython: 0.28.2 numpy: 1.14.3 scipy: None pyarrow: None xarray: None IPython: None sphinx: None patsy: None dateutil: 2.7.2 pytz: 2018.4 blosc: None bottleneck: None tables: None numexpr: None feather: None matplotlib: None openpyxl: None xlrd: None xlwt: None xlsxwriter: None lxml: None bs4: None html5lib: None sqlalchemy: None pymysql: None psycopg2: None jinja2: None s3fs: None fastparquet: None pandas_gbq: None pandas_datareader: None
The text was updated successfully, but these errors were encountered:
xref #17284 (comment)
Not exactly a dupe of that issue, but the same fix will probably resolve both of these.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Code Sample, a copy-pastable example if possible
Problem description
50 is contained in the interval (1, 100), so this should not raise
KeyError
.Expected Output
0
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: c4da79b
python: 3.6.3.final.0
python-bits: 64
OS: Linux
OS-release: 4.13.0-39-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8
LOCALE: en_US.UTF-8
pandas: 0.23.0.dev0+824.gc4da79b5b
pytest: None
pip: 10.0.1
setuptools: 39.1.0
Cython: 0.28.2
numpy: 1.14.3
scipy: None
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.7.2
pytz: 2018.4
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: