@@ -1166,7 +1166,25 @@ def _get_slice_axis(self, slice_obj, axis=0):
1166
1166
1167
1167
class _IXIndexer (_NDFrameIndexer ):
1168
1168
1169
- """ A primarily location based indexer, with integer fallback """
1169
+ """A primarily label-location based indexer, with integer position
1170
+ fallback.
1171
+
1172
+ ``.ix[]`` supports mixed integer and label based access. It is
1173
+ primarily label based, but will fall back to integer positional
1174
+ access unless the corresponding axis is of integer type.
1175
+
1176
+ ``.ix`` is the most general indexer and will support any of the
1177
+ inputs in ``.loc`` and ``.iloc``. ``.ix`` also supports floating
1178
+ point label schemes. ``.ix`` is exceptionally useful when dealing
1179
+ with mixed positional and label based hierachical indexes.
1180
+
1181
+ However, when an axis is integer based, ONLY label based access
1182
+ and not positional access is supported. Thus, in such cases, it's
1183
+ usually better to be explicit and use ``.iloc`` or ``.loc``.
1184
+
1185
+ See more at :ref:`Advanced Indexing <advanced>`.
1186
+
1187
+ """
1170
1188
1171
1189
def _has_valid_type (self , key , axis ):
1172
1190
if isinstance (key , slice ):
@@ -1224,7 +1242,27 @@ def _get_slice_axis(self, slice_obj, axis=0):
1224
1242
1225
1243
class _LocIndexer (_LocationIndexer ):
1226
1244
1227
- """ purely label based location based indexing """
1245
+ """Purely label-location based indexer for selection by label.
1246
+
1247
+ ``.loc[]`` is primarily label based, but may also be used with a
1248
+ boolean array.
1249
+
1250
+ Allowed inputs are:
1251
+
1252
+ - A single label, e.g. ``5`` or ``'a'``, (note that ``5`` is
1253
+ interpreted as a *label* of the index, and **never** as an
1254
+ integer position along the index).
1255
+ - A list or array of labels, e.g. ``['a', 'b', 'c']``.
1256
+ - A slice object with labels, e.g. ``'a':'f'`` (note that contrary
1257
+ to usual python slices, **both** the start and the stop are included!).
1258
+ - A boolean array.
1259
+
1260
+ ``.loc`` will raise a ``KeyError`` when the items are not found.
1261
+
1262
+ See more at :ref:`Selection by Label <indexing.label>`
1263
+
1264
+ """
1265
+
1228
1266
_valid_types = ("labels (MUST BE IN THE INDEX), slices of labels (BOTH "
1229
1267
"endpoints included! Can be slices of integers if the "
1230
1268
"index is integers), listlike of labels, boolean" )
@@ -1340,7 +1378,27 @@ def _getitem_axis(self, key, axis=0):
1340
1378
1341
1379
class _iLocIndexer (_LocationIndexer ):
1342
1380
1343
- """ purely integer based location based indexing """
1381
+ """Purely integer-location based indexing for selection by position.
1382
+
1383
+ ``.iloc[]`` is primarily integer position based (from ``0`` to
1384
+ ``length-1`` of the axis), but may also be used with a boolean
1385
+ array.
1386
+
1387
+ Allowed inputs are:
1388
+
1389
+ - An integer, e.g. ``5``.
1390
+ - A list or array of integers, e.g. ``[4, 3, 0]``.
1391
+ - A slice object with ints, e.g. ``1:7``.
1392
+ - A boolean array.
1393
+
1394
+ ``.iloc`` will raise ``IndexError`` if a requested indexer is
1395
+ out-of-bounds, except *slice* indexers which allow out-of-bounds
1396
+ indexing (this conforms with python/numpy *slice* semantics).
1397
+
1398
+ See more at :ref:`Selection by Position <indexing.integer>`
1399
+
1400
+ """
1401
+
1344
1402
_valid_types = ("integer, integer slice (START point is INCLUDED, END "
1345
1403
"point is EXCLUDED), listlike of integers, boolean array" )
1346
1404
_exception = IndexError
@@ -1512,7 +1570,13 @@ def __setitem__(self, key, value):
1512
1570
1513
1571
class _AtIndexer (_ScalarAccessIndexer ):
1514
1572
1515
- """ label based scalar accessor """
1573
+ """Fast label-based scalar accessor
1574
+
1575
+ Similarly to ``loc``, ``at`` provides **label** based scalar lookups.
1576
+ You can also set using these indexers.
1577
+
1578
+ """
1579
+
1516
1580
_takeable = False
1517
1581
1518
1582
def _convert_key (self , key , is_setter = False ):
@@ -1535,7 +1599,13 @@ def _convert_key(self, key, is_setter=False):
1535
1599
1536
1600
class _iAtIndexer (_ScalarAccessIndexer ):
1537
1601
1538
- """ integer based scalar accessor """
1602
+ """Fast integer location scalar accessor.
1603
+
1604
+ Similarly to ``iloc``, ``iat`` provides **integer** based lookups.
1605
+ You can also set using these indexers.
1606
+
1607
+ """
1608
+
1539
1609
_takeable = True
1540
1610
1541
1611
def _has_valid_setitem_indexer (self , indexer ):
0 commit comments