BUG: IntervalIndex.get_indexer fails for homogeneous Period targets #30178
Labels
good first issue
Indexing
Related to indexing on series/frames, not to indexes themselves
Interval
Interval data type
Needs Tests
Unit test(s) needed to prevent regressions
Period
Period data type
Code Sample, a copy-pastable example if possible
Note that heterogeneous targets containing
Period
objects are okay, as they get coerced toobject
dtype:xref #30063 (comment)
Problem description
Homogeneous
Period
targets incorrectly raise aTypeError
forIntervalIndex.get_indexer
.Expected Output
I'd expect
IntervalIndex.get_indexer
to return an array indicating all values are missing (-1) for homogeneousPeriod
targets.Output of
pd.show_versions()
INSTALLED VERSIONS
commit : 52f5fdf
python : 3.7.4.final.0
python-bits : 64
OS : Linux
OS-release : 4.19.14-041914-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 0.26.0.dev0+1256.g52f5fdf10
numpy : 1.17.2
pytz : 2019.2
dateutil : 2.8.0
pip : 19.2.3
setuptools : 41.6.0.post20191030
Cython : 0.29.13
pytest : 5.2.0
hypothesis : 4.36.2
sphinx : 1.8.5
blosc : None
feather : None
xlsxwriter : 1.2.1
lxml.etree : 4.4.1
html5lib : 1.0.1
pymysql : None
psycopg2 : None
jinja2 : 2.10.1
IPython : 7.8.0
pandas_datareader: None
bs4 : 4.8.0
bottleneck : 1.2.1
fastparquet : 0.3.2
gcsfs : None
lxml.etree : 4.4.1
matplotlib : 3.1.1
numexpr : 2.7.0
odfpy : None
openpyxl : 3.0.0
pandas_gbq : None
pyarrow : 0.15.0
pytables : None
pytest : 5.2.0
s3fs : 0.3.4
scipy : 1.3.1
sqlalchemy : 1.3.8
tables : 3.5.1
xarray : 0.13.0
xlrd : 1.2.0
xlwt : 1.3.0
xlsxwriter : 1.2.1
The text was updated successfully, but these errors were encountered: