|
4 | 4 |
|
5 | 5 | import builtins
|
6 | 6 | import textwrap
|
7 |
| -from typing import FrozenSet, List, Optional, Union |
| 7 | +from typing import Dict, FrozenSet, List, Optional, Union |
8 | 8 |
|
9 | 9 | import numpy as np
|
10 | 10 |
|
|
36 | 36 | from pandas.core.construction import create_series_with_explicit_dtype
|
37 | 37 | import pandas.core.nanops as nanops
|
38 | 38 |
|
| 39 | +_shared_docs: Dict[str, str] = dict() |
39 | 40 | _indexops_doc_kwargs = dict(
|
40 | 41 | klass="IndexOpsMixin",
|
41 | 42 | inplace="",
|
@@ -1401,9 +1402,9 @@ def memory_usage(self, deep=False):
|
1401 | 1402 | def factorize(self, sort=False, na_sentinel=-1):
|
1402 | 1403 | return algorithms.factorize(self, sort=sort, na_sentinel=na_sentinel)
|
1403 | 1404 |
|
1404 |
| - @doc(klass="Index") |
1405 |
| - def searchsorted(self, value, side="left", sorter=None) -> np.ndarray: |
1406 |
| - """ |
| 1405 | + _shared_docs[ |
| 1406 | + "searchsorted" |
| 1407 | + ] = """ |
1407 | 1408 | Find indices where elements should be inserted to maintain order.
|
1408 | 1409 |
|
1409 | 1410 | Find the indices into a sorted {klass} `self` such that, if the
|
@@ -1487,6 +1488,9 @@ def searchsorted(self, value, side="left", sorter=None) -> np.ndarray:
|
1487 | 1488 | >>> x.searchsorted(1)
|
1488 | 1489 | 0 # wrong result, correct would be 1
|
1489 | 1490 | """
|
| 1491 | + |
| 1492 | + @doc(_shared_docs["searchsorted"], klass="Index") |
| 1493 | + def searchsorted(self, value, side="left", sorter=None) -> np.ndarray: |
1490 | 1494 | return algorithms.searchsorted(self._values, value, side=side, sorter=sorter)
|
1491 | 1495 |
|
1492 | 1496 | def drop_duplicates(self, keep="first", inplace=False):
|
|
0 commit comments