Skip to content

Commit 10ba2d2

Browse files
authored
DOC: Add docs for Series.__invert__ (~); add cross-link from Boolean indexing
Add dedicated API page for Series.__invert__() so searches for “invert/~” find it.
1 parent e34048d commit 10ba2d2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/source/user_guide/indexing.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,10 @@ evaluate an expression such as ``df['A'] > 2 & df['B'] < 3`` as
811811
``df['A'] > (2 & df['B']) < 3``, while the desired evaluation order is
812812
``(df['A'] > 2) & (df['B'] < 3)``.
813813

814+
For toggling boolean masks with the ``~`` operator, see
815+
:meth:`pandas.Series.__invert__`.
816+
817+
814818
Using a boolean vector to index a Series works exactly as in a NumPy ndarray:
815819

816820
.. ipython:: python

0 commit comments

Comments
 (0)