diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index eff7ff2c9f347..caf881ef069e6 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -52,6 +52,7 @@ _index_doc_kwargs = dict(klass='Index', inplace='', target_klass='Index', + raises_section='', unique='Index', duplicated='np.ndarray') _index_shared_docs = dict() @@ -2787,7 +2788,7 @@ def get_loc(self, key, method=None, tolerance=None): Integers from 0 to n - 1 indicating that the index at these positions matches the corresponding target values. Missing values in the target are marked by -1. - + %(raises_section)s Examples -------- >>> index = pd.Index(['c', 'a', 'b']) diff --git a/pandas/core/indexes/interval.py b/pandas/core/indexes/interval.py index 87216dcc7b957..a3b162a91ed19 100644 --- a/pandas/core/indexes/interval.py +++ b/pandas/core/indexes/interval.py @@ -8,7 +8,7 @@ from pandas._libs import Timedelta, Timestamp from pandas._libs.interval import Interval, IntervalMixin, IntervalTree -from pandas.util._decorators import Appender, cache_readonly +from pandas.util._decorators import Appender, Substitution, cache_readonly from pandas.util._exceptions import rewrite_exception from pandas.core.dtypes.cast import ( @@ -805,7 +805,15 @@ def get_value(self, series, key): loc = self.get_loc(key) return series.iloc[loc] - @Appender(_index_shared_docs['get_indexer'] % _index_doc_kwargs) + @Substitution(**dict(_index_doc_kwargs, + **{'raises_section': textwrap.dedent(""" + Raises + ------ + NotImplementedError + If any method argument other than the default of + None is specified as these are not yet implemented. + """)})) + @Appender(_index_shared_docs['get_indexer']) def get_indexer(self, target, method=None, limit=None, tolerance=None): self._check_method(method)