File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -781,3 +781,41 @@ def make_flex_doc(op_name: str, typ: str) -> str:
781781 B True False
782782 C True False
783783"""
784+
785+ # --- add at bottom of pandas/core/ops/docstrings.py ---
786+
787+ _doc_series_invert = """
788+ Bitwise NOT (``~``).
789+
790+ For boolean dtype, behaves as logical NOT. Missing values (``NA``) propagate.
791+ For integer dtypes, performs bitwise inversion (two's complement) elementwise.
792+
793+ Returns
794+ -------
795+ Series
796+ Elementwise result with the same index and name.
797+
798+ Notes
799+ -----
800+ On ``boolean[pyarrow]`` dtype, ``NA`` values also propagate under ``~``.
801+
802+ See Also
803+ --------
804+ Series.__and__, Series.__or__, Series.__xor__
805+
806+ Examples
807+ --------
808+ >>> s = pd.Series([True, False, pd.NA], dtype="boolean")
809+ >>> ~s
810+ 0 False
811+ 1 True
812+ 2 <NA>
813+ dtype: boolean
814+
815+ >>> s = pd.Series([1, 2, -3], dtype="Int32")
816+ >>> ~s
817+ 0 -2
818+ 1 -3
819+ 2 2
820+ dtype: Int32
821+ """
You can’t perform that action at this time.
0 commit comments