Skip to content

IntervalIndex.get_loc doctest failing #24931

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

Closed
TomAugspurger opened this issue Jan 25, 2019 · 0 comments · Fixed by #27100
Closed

IntervalIndex.get_loc doctest failing #24931

TomAugspurger opened this issue Jan 25, 2019 · 0 comments · Fixed by #27100
Labels
Docs Interval Interval data type
Milestone

Comments

@TomAugspurger
Copy link
Contributor

$ pytest --doctest-modules pandas/core/indexes/interval.py  -k get_loc
========================================================================================================================================================================== test session starts ===========================================================================================================================================================================
platform darwin -- Python 3.7.2, pytest-4.1.0, py-1.6.0, pluggy-0.7.1
rootdir: /Users/taugspurger/sandbox/pandas, inifile: setup.cfg
plugins: xdist-1.23.2, repeat-0.7.0, forked-0.2, faulthandler-1.5.0, cov-2.6.0, hypothesis-3.59.1
collected 12 items / 11 deselected

pandas/core/indexes/interval.py F                                                                                                                                                                                                                                                                                                                                  [100%]

================================================================================================================================================================================ FAILURES ================================================================================================================================================================================
______________________________________________________________________________________________________________________________________________________ [doctest] pandas.core.indexes.interval.IntervalIndex.get_loc ______________________________________________________________________________________________________________________________________________________
735         ---------
736         >>> i1, i2 = pd.Interval(0, 1), pd.Interval(1, 2)
737         >>> index = pd.IntervalIndex([i1, i2])
738         >>> index.get_loc(1)
739         0
740
741         You can also supply an interval or an location for a point inside an
742         interval.
743
744         >>> index.get_loc(pd.Interval(0, 2))
Expected:
    array([0, 1], dtype=int64)
Got:
    slice(0, 2, None)

/Users/taugspurger/sandbox/pandas/pandas/core/indexes/interval.py:744: DocTestFailure
================================================================================================================================================================ 1 failed, 11 deselected in 0.02 seconds =================================================================================================================================================================
@TomAugspurger TomAugspurger added Docs Interval Interval data type labels Jan 25, 2019
@jorisvandenbossche jorisvandenbossche added this to the 0.25.0 milestone May 10, 2019
@jreback jreback modified the milestones: 0.25.0, Contributions Welcome May 12, 2019
@jreback jreback modified the milestones: Contributions Welcome, 0.25.0 Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Interval Interval data type
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants