File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 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":
255255
256256 - A boolean array of the same length as the axis being sliced,
257257 e.g. ``[True, False, True]``.
258+ - An alignable boolean Series. The index of the key will be aligned before
259+ masking.
258260 - A ``callable`` function with one argument (the calling Series or
259261 DataFrame) and that returns valid output for indexing (one of the above)
260262
@@ -264,6 +266,8 @@ def loc(self) -> "_LocIndexer":
264266 ------
265267 KeyError
266268 If any items are not found.
269+ IndexingError
270+ If an indexed key is passed and its index is unalignable to the frame index.
267271
268272 See Also
269273 --------
@@ -319,6 +323,13 @@ def loc(self) -> "_LocIndexer":
319323 max_speed shield
320324 sidewinder 7 8
321325
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+
322333 Conditional that returns a boolean Series
323334
324335 >>> df.loc[df['shield'] > 6]
You can’t perform that action at this time.
0 commit comments