File tree 1 file changed +11
-0
lines changed
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -255,6 +255,8 @@ def loc(self) -> "_LocIndexer":
255
255
256
256
- A boolean array of the same length as the axis being sliced,
257
257
e.g. ``[True, False, True]``.
258
+ - An alignable boolean Series. The index of the key will be aligned before
259
+ masking.
258
260
- A ``callable`` function with one argument (the calling Series or
259
261
DataFrame) and that returns valid output for indexing (one of the above)
260
262
@@ -264,6 +266,8 @@ def loc(self) -> "_LocIndexer":
264
266
------
265
267
KeyError
266
268
If any items are not found.
269
+ IndexingError
270
+ If an indexed key is passed and its index is unalignable to the frame index.
267
271
268
272
See Also
269
273
--------
@@ -319,6 +323,13 @@ def loc(self) -> "_LocIndexer":
319
323
max_speed shield
320
324
sidewinder 7 8
321
325
326
+ Alignable boolean Series:
327
+
328
+ >>> df.loc[pd.Series([False, True, False],
329
+ ... index=['viper', 'sidewinder', 'cobra'])]
330
+ max_speed shield
331
+ sidewinder 7 8
332
+
322
333
Conditional that returns a boolean Series
323
334
324
335
>>> df.loc[df['shield'] > 6]
You can’t perform that action at this time.
0 commit comments