Skip to content

Commit c253c6d

Browse files
committed
fix doc-string
- denoted examples - add see also
1 parent bc8ae8a commit c253c6d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/core/indexes/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,6 +1300,7 @@ def set_names(self, names, level=None, inplace=False):
13001300
Int64Index([1, 2, 3, 4], dtype='int64', name='foo')
13011301
>>> pd.Index([1, 2, 3, 4]).set_names(['foo'])
13021302
Int64Index([1, 2, 3, 4], dtype='int64', name='foo')
1303+
13031304
>>> idx = pd.MultiIndex.from_tuples([(1, u'one'), (1, u'two'),
13041305
(2, u'one'), (2, u'two')],
13051306
names=['foo', 'bar'])
@@ -1311,6 +1312,10 @@ def set_names(self, names, level=None, inplace=False):
13111312
MultiIndex(levels=[[1, 2], [u'one', u'two']],
13121313
labels=[[0, 0, 1, 1], [0, 1, 0, 1]],
13131314
names=[u'baz', u'bar'])
1315+
1316+
See also
1317+
--------
1318+
rename : able to set new names without level
13141319
"""
13151320

13161321
from .multi import MultiIndex
@@ -1359,6 +1364,7 @@ def rename(self, name, inplace=False):
13591364
Int64Index([1, 2, 3, 4], dtype='int64', name='foo')
13601365
>>> idx.rename('bar')
13611366
Int64Index([1, 2, 3, 4], dtype='int64', name='bar')
1367+
13621368
>>> idx = MultiIndex.from_tuples([(1, u'one'), (1, u'two'),
13631369
(2, u'one'), (2, u'two')],
13641370
names=['foo', 'bar'])

0 commit comments

Comments
 (0)