Skip to content

Issue/26506 Provides correct desciption in docstring that get_indexer methods are not yet supported #26519

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

Merged
merged 18 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@

_index_doc_kwargs = dict(klass='Index', inplace='',
target_klass='Index',
method_param_pad_notes='',
method_param_backfill_notes='',
method_param_nearest_notes='',
unique='Index', duplicated='np.ndarray')
_index_shared_docs = dict()

Expand Down Expand Up @@ -2761,10 +2764,13 @@ def get_loc(self, key, method=None, tolerance=None):
target : %(target_klass)s
method : {None, 'pad'/'ffill', 'backfill'/'bfill', 'nearest'}, optional
* default: exact matches only.
* pad / ffill: find the PREVIOUS index value if no exact match.
* backfill / bfill: use NEXT index value if no exact match
* pad / ffill: find the PREVIOUS index value if no exact
match%(method_param_pad_notes)s.
* backfill / bfill: use NEXT index value if no exact
match%(method_param_backfill_notes)s.
* nearest: use the NEAREST index value if no exact match. Tied
distances are broken by preferring the larger index value.
distances are broken by preferring the larger index
value%(method_param_nearest_notes)s.
limit : int, optional
Maximum number of consecutive labels in ``target`` to match for
inexact matches.
Expand Down
5 changes: 5 additions & 0 deletions pandas/core/indexes/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
dict(klass='IntervalIndex',
qualname="IntervalIndex",
target_klass='IntervalIndex or list of Intervals',
method_param_pad_notes=' (not yet supported)',
method_param_backfill_notes=' (not yet supported)',
method_param_nearest_notes=' (not yet supported)',
name=textwrap.dedent("""\
name : object, optional
Name to be stored in the index.
Expand Down Expand Up @@ -648,6 +651,8 @@ def _check_method(self, method):
return

if method in ['bfill', 'backfill', 'pad', 'ffill', 'nearest']:
# The documentation warns these methods are not implemented so if
# this is fixed please fix the doc string.
msg = 'method {method} not yet implemented for IntervalIndex'
raise NotImplementedError(msg.format(method=method))

Expand Down