@@ -346,9 +346,9 @@ def set_levels(self, levels, level=None, inplace=False,
346
346
347
347
Examples
348
348
--------
349
- >>> idx = MultiIndex.from_tuples([(1, u'one'), (1, u'two'),
350
- (2, u'one'), (2, u'two')],
351
- names=['foo', 'bar'])
349
+ >>> idx = pd. MultiIndex.from_tuples([(1, u'one'), (1, u'two'),
350
+ (2, u'one'), (2, u'two')],
351
+ names=['foo', 'bar'])
352
352
>>> idx.set_levels([['a','b'], [1,2]])
353
353
MultiIndex(levels=[[u'a', u'b'], [1, 2]],
354
354
labels=[[0, 0, 1, 1], [0, 1, 0, 1]],
@@ -442,9 +442,9 @@ def set_labels(self, labels, level=None, inplace=False,
442
442
443
443
Examples
444
444
--------
445
- >>> idx = MultiIndex.from_tuples([(1, u'one'), (1, u'two'),
446
- (2, u'one'), (2, u'two')],
447
- names=['foo', 'bar'])
445
+ >>> idx = pd. MultiIndex.from_tuples([(1, u'one'), (1, u'two'),
446
+ (2, u'one'), (2, u'two')],
447
+ names=['foo', 'bar'])
448
448
>>> idx.set_labels([[1,0,1,0], [0,0,1,1]])
449
449
MultiIndex(levels=[[1, 2], [u'one', u'two']],
450
450
labels=[[1, 0, 1, 0], [0, 0, 1, 1]],
@@ -1192,8 +1192,8 @@ def to_hierarchical(self, n_repeat, n_shuffle=1):
1192
1192
1193
1193
Examples
1194
1194
--------
1195
- >>> idx = MultiIndex.from_tuples([(1, u'one'), (1, u'two'),
1196
- (2, u'one'), (2, u'two')])
1195
+ >>> idx = pd. MultiIndex.from_tuples([(1, u'one'), (1, u'two'),
1196
+ (2, u'one'), (2, u'two')])
1197
1197
>>> idx.to_hierarchical(3)
1198
1198
MultiIndex(levels=[[1, 2], [u'one', u'two']],
1199
1199
labels=[[0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1],
@@ -1255,7 +1255,7 @@ def from_arrays(cls, arrays, sortorder=None, names=None):
1255
1255
Examples
1256
1256
--------
1257
1257
>>> arrays = [[1, 1, 2, 2], ['red', 'blue', 'red', 'blue']]
1258
- >>> MultiIndex.from_arrays(arrays, names=('number', 'color'))
1258
+ >>> pd. MultiIndex.from_arrays(arrays, names=('number', 'color'))
1259
1259
1260
1260
See Also
1261
1261
--------
@@ -1304,7 +1304,7 @@ def from_tuples(cls, tuples, sortorder=None, names=None):
1304
1304
--------
1305
1305
>>> tuples = [(1, u'red'), (1, u'blue'),
1306
1306
(2, u'red'), (2, u'blue')]
1307
- >>> MultiIndex.from_tuples(tuples, names=('number', 'color'))
1307
+ >>> pd. MultiIndex.from_tuples(tuples, names=('number', 'color'))
1308
1308
1309
1309
See Also
1310
1310
--------
@@ -1357,8 +1357,8 @@ def from_product(cls, iterables, sortorder=None, names=None):
1357
1357
--------
1358
1358
>>> numbers = [0, 1, 2]
1359
1359
>>> colors = [u'green', u'purple']
1360
- >>> MultiIndex.from_product([numbers, colors],
1361
- names=['number', 'color'])
1360
+ >>> pd. MultiIndex.from_product([numbers, colors],
1361
+ names=['number', 'color'])
1362
1362
MultiIndex(levels=[[0, 1, 2], [u'green', u'purple']],
1363
1363
labels=[[0, 0, 1, 1, 2, 2], [0, 1, 0, 1, 0, 1]],
1364
1364
names=[u'number', u'color'])
0 commit comments