diff --git a/pandas/core/frame.py b/pandas/core/frame.py index ead4ea744c647..39bbfc75b0376 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8564,7 +8564,9 @@ def pivot(self, index=None, columns=None, values=None) -> DataFrame: margins : bool, default False Add all row / columns (e.g. for subtotal / grand totals). dropna : bool, default True - Do not include columns whose entries are all NaN. + Do not include columns whose entries are all NaN. If True, + rows with a NaN value in any column will be omitted before + computing margins. margins_name : str, default 'All' Name of the row / column that will contain the totals when margins is True.