@@ -57,7 +57,7 @@ def _codes_to_ints(self, codes):
57
57
Combinations of integers (one per row)
58
58
59
59
Returns
60
- ------
60
+ -------
61
61
int_keys : scalar or 1-dimensional array, of dtype uint64
62
62
Integer(s) representing one combination (each).
63
63
"""
@@ -97,7 +97,7 @@ def _codes_to_ints(self, codes):
97
97
Combinations of integers (one per row)
98
98
99
99
Returns
100
- ------
100
+ -------
101
101
int_keys : int, or 1-dimensional array of dtype object
102
102
Integer(s) representing one combination (each).
103
103
"""
@@ -179,8 +179,13 @@ class MultiIndex(Index):
179
179
MultiIndex.from_frame : Make a MultiIndex from a DataFrame.
180
180
Index : The base pandas Index type.
181
181
182
+ Notes
183
+ -----
184
+ See the `user guide
185
+ <http://pandas.pydata.org/pandas-docs/stable/advanced.html>`_ for more.
186
+
182
187
Examples
183
- ---------
188
+ --------
184
189
A new ``MultiIndex`` is typically constructed using one of the helper
185
190
methods :meth:`MultiIndex.from_arrays`, :meth:`MultiIndex.from_product`
186
191
and :meth:`MultiIndex.from_tuples`. For example (using ``.from_arrays``):
@@ -193,11 +198,6 @@ class MultiIndex(Index):
193
198
194
199
See further examples for how to construct a MultiIndex in the doc strings
195
200
of the mentioned helper methods.
196
-
197
- Notes
198
- -----
199
- See the `user guide
200
- <http://pandas.pydata.org/pandas-docs/stable/advanced.html>`_ for more.
201
201
"""
202
202
203
203
# initialize to zero-length tuples to make everything work
@@ -1398,7 +1398,7 @@ def get_level_values(self, level):
1398
1398
a single :class:`Index` (or subclass thereof).
1399
1399
1400
1400
Examples
1401
- ---------
1401
+ --------
1402
1402
1403
1403
Create a MultiIndex:
1404
1404
@@ -2367,29 +2367,29 @@ def get_loc(self, key, method=None):
2367
2367
If the key is past the lexsort depth, the return may be a
2368
2368
boolean mask array, otherwise it is always a slice or int.
2369
2369
2370
+ See Also
2371
+ --------
2372
+ Index.get_loc : The get_loc method for (single-level) index.
2373
+ MultiIndex.slice_locs : Get slice location given start label(s) and
2374
+ end label(s).
2375
+ MultiIndex.get_locs : Get location for a label/slice/list/mask or a
2376
+ sequence of such.
2377
+
2378
+ Notes
2379
+ -----
2380
+ The key cannot be a slice, list of same-level labels, a boolean mask,
2381
+ or a sequence of such. If you want to use those, use
2382
+ :meth:`MultiIndex.get_locs` instead.
2383
+
2370
2384
Examples
2371
- ---------
2385
+ --------
2372
2386
>>> mi = pd.MultiIndex.from_arrays([list('abb'), list('def')])
2373
2387
2374
2388
>>> mi.get_loc('b')
2375
2389
slice(1, 3, None)
2376
2390
2377
2391
>>> mi.get_loc(('b', 'e'))
2378
2392
1
2379
-
2380
- Notes
2381
- ------
2382
- The key cannot be a slice, list of same-level labels, a boolean mask,
2383
- or a sequence of such. If you want to use those, use
2384
- :meth:`MultiIndex.get_locs` instead.
2385
-
2386
- See Also
2387
- --------
2388
- Index.get_loc : The get_loc method for (single-level) index.
2389
- MultiIndex.slice_locs : Get slice location given start label(s) and
2390
- end label(s).
2391
- MultiIndex.get_locs : Get location for a label/slice/list/mask or a
2392
- sequence of such.
2393
2393
"""
2394
2394
if method is not None :
2395
2395
raise NotImplementedError ('only the default get_loc method is '
@@ -2470,6 +2470,12 @@ def get_loc_level(self, key, level=0, drop_level=True):
2470
2470
Element 1: The resulting sliced multiindex/index. If the key
2471
2471
contains all levels, this will be ``None``.
2472
2472
2473
+ See Also
2474
+ --------
2475
+ MultiIndex.get_loc : Get location for a label or a tuple of labels.
2476
+ MultiIndex.get_locs : Get location for a label/slice/list/mask or a
2477
+ sequence of such.
2478
+
2473
2479
Examples
2474
2480
--------
2475
2481
>>> mi = pd.MultiIndex.from_arrays([list('abb'), list('def')],
@@ -2484,12 +2490,6 @@ def get_loc_level(self, key, level=0, drop_level=True):
2484
2490
2485
2491
>>> mi.get_loc_level(['b', 'e'])
2486
2492
(1, None)
2487
-
2488
- See Also
2489
- ---------
2490
- MultiIndex.get_loc : Get location for a label or a tuple of labels.
2491
- MultiIndex.get_locs : Get location for a label/slice/list/mask or a
2492
- sequence of such.
2493
2493
"""
2494
2494
2495
2495
def maybe_droplevels (indexer , levels , drop_level ):
@@ -2698,7 +2698,7 @@ def get_locs(self, seq):
2698
2698
locs : array of integers suitable for passing to iloc
2699
2699
2700
2700
Examples
2701
- ---------
2701
+ --------
2702
2702
>>> mi = pd.MultiIndex.from_arrays([list('abb'), list('def')])
2703
2703
2704
2704
>>> mi.get_locs('b')
0 commit comments