Skip to content

Commit 21d2a5f

Browse files
author
tp
committed
use target_klass so class name is properly updated for subclasses
1 parent 0f16e2e commit 21d2a5f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/core/indexes/base.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2454,20 +2454,20 @@ def _get_unique_index(self, dropna=False):
24542454
24552455
Examples
24562456
---------
2457-
>>> unique_index = pd.Index(list('abc'))
2457+
>>> unique_index = pd.%(target_klass)s(list('abc'))
24582458
>>> unique_index.get_loc('b')
24592459
1
24602460
2461-
>>> monotonic_index = pd.Index(list('abbc'))
2461+
>>> monotonic_index = pd.%(target_klass)s(list('abbc'))
24622462
>>> monotonic_index.get_loc('b')
24632463
slice(1, 3, None)
24642464
2465-
>>> non_monotonic_index = pd.Index(list('abcb'))
2465+
>>> non_monotonic_index = pd.%(target_klass)s(list('abcb'))
24662466
>>> non_monotonic_index.get_loc('b')
24672467
array([False, True, False, True], dtype=bool)
24682468
"""
24692469

2470-
@Appender(_index_shared_docs['get_loc'])
2470+
@Appender(_index_shared_docs['get_loc'] %(_index_doc_kwargs))
24712471
def get_loc(self, key, method=None, tolerance=None):
24722472
if method is None:
24732473
if tolerance is not None:

0 commit comments

Comments
 (0)