@@ -1170,7 +1170,25 @@ def _get_slice_axis(self, slice_obj, axis=0):
1170
1170
1171
1171
class _IXIndexer (_NDFrameIndexer ):
1172
1172
1173
- """ A primarily location based indexer, with integer fallback """
1173
+ """A primarily label-location based indexer, with integer position
1174
+ fallback.
1175
+
1176
+ ``.ix[]`` supports mixed integer and label based access. It is
1177
+ primarily label based, but will fall back to integer positional
1178
+ access unless the corresponding axis is of integer type.
1179
+
1180
+ ``.ix`` is the most general indexer and will support any of the
1181
+ inputs in ``.loc`` and ``.iloc``. ``.ix`` also supports floating
1182
+ point label schemes. ``.ix`` is exceptionally useful when dealing
1183
+ with mixed positional and label based hierachical indexes.
1184
+
1185
+ However, when an axis is integer based, ONLY label based access
1186
+ and not positional access is supported. Thus, in such cases, it's
1187
+ usually better to be explicit and use ``.iloc`` or ``.loc``.
1188
+
1189
+ See more at :ref:`Advanced Indexing <advanced>`.
1190
+
1191
+ """
1174
1192
1175
1193
def _has_valid_type (self , key , axis ):
1176
1194
if isinstance (key , slice ):
@@ -1228,7 +1246,27 @@ def _get_slice_axis(self, slice_obj, axis=0):
1228
1246
1229
1247
class _LocIndexer (_LocationIndexer ):
1230
1248
1231
- """ purely label based location based indexing """
1249
+ """Purely label-location based indexer for selection by label.
1250
+
1251
+ ``.loc[]`` is primarily label based, but may also be used with a
1252
+ boolean array.
1253
+
1254
+ Allowed inputs are:
1255
+
1256
+ - A single label, e.g. ``5`` or ``'a'``, (note that ``5`` is
1257
+ interpreted as a *label* of the index, and **never** as an
1258
+ integer position along the index).
1259
+ - A list or array of labels, e.g. ``['a', 'b', 'c']``.
1260
+ - A slice object with labels, e.g. ``'a':'f'`` (note that contrary
1261
+ to usual python slices, **both** the start and the stop are included!).
1262
+ - A boolean array.
1263
+
1264
+ ``.loc`` will raise a ``KeyError`` when the items are not found.
1265
+
1266
+ See more at :ref:`Selection by Label <indexing.label>`
1267
+
1268
+ """
1269
+
1232
1270
_valid_types = ("labels (MUST BE IN THE INDEX), slices of labels (BOTH "
1233
1271
"endpoints included! Can be slices of integers if the "
1234
1272
"index is integers), listlike of labels, boolean" )
@@ -1326,7 +1364,27 @@ def _getitem_axis(self, key, axis=0):
1326
1364
1327
1365
class _iLocIndexer (_LocationIndexer ):
1328
1366
1329
- """ purely integer based location based indexing """
1367
+ """Purely integer-location based indexing for selection by position.
1368
+
1369
+ ``.iloc[]`` is primarily integer position based (from ``0`` to
1370
+ ``length-1`` of the axis), but may also be used with a boolean
1371
+ array.
1372
+
1373
+ Allowed inputs are:
1374
+
1375
+ - An integer, e.g. ``5``.
1376
+ - A list or array of integers, e.g. ``[4, 3, 0]``.
1377
+ - A slice object with ints, e.g. ``1:7``.
1378
+ - A boolean array.
1379
+
1380
+ ``.iloc`` will raise ``IndexError`` if a requested indexer is
1381
+ out-of-bounds, except *slice* indexers which allow out-of-bounds
1382
+ indexing (this conforms with python/numpy *slice* semantics).
1383
+
1384
+ See more at :ref:`Selection by Position <indexing.integer>`
1385
+
1386
+ """
1387
+
1330
1388
_valid_types = ("integer, integer slice (START point is INCLUDED, END "
1331
1389
"point is EXCLUDED), listlike of integers, boolean array" )
1332
1390
_exception = IndexError
@@ -1498,7 +1556,13 @@ def __setitem__(self, key, value):
1498
1556
1499
1557
class _AtIndexer (_ScalarAccessIndexer ):
1500
1558
1501
- """ label based scalar accessor """
1559
+ """Fast label-based scalar accessor
1560
+
1561
+ Similarly to ``loc``, ``at`` provides **label** based scalar lookups.
1562
+ You can also set using these indexers.
1563
+
1564
+ """
1565
+
1502
1566
_takeable = False
1503
1567
1504
1568
def _convert_key (self , key , is_setter = False ):
@@ -1521,7 +1585,13 @@ def _convert_key(self, key, is_setter=False):
1521
1585
1522
1586
class _iAtIndexer (_ScalarAccessIndexer ):
1523
1587
1524
- """ integer based scalar accessor """
1588
+ """Fast integer location scalar accessor.
1589
+
1590
+ Similarly to ``iloc``, ``iat`` provides **integer** based lookups.
1591
+ You can also set using these indexers.
1592
+
1593
+ """
1594
+
1525
1595
_takeable = True
1526
1596
1527
1597
def _has_valid_setitem_indexer (self , indexer ):
0 commit comments