diff --git a/pandas/core/ops/docstrings.py b/pandas/core/ops/docstrings.py index aa469c2e07726..9c3158b3465b7 100644 --- a/pandas/core/ops/docstrings.py +++ b/pandas/core/ops/docstrings.py @@ -461,7 +461,7 @@ def make_flex_doc(op_name: str, typ: str) -> str: Parameters ---------- -other : scalar, sequence, Series, or DataFrame +other : scalar, sequence, Series, dict or DataFrame Any single or multiple element data structure, or list-like object. axis : {{0 or 'index', 1 or 'columns'}} Whether to compare by the index (0 or 'index') or columns. @@ -556,6 +556,20 @@ def make_flex_doc(op_name: str, typ: str) -> str: triangle 2 179 rectangle 3 359 +Multiply a dictionary by axis. + +>>> df.mul({{'angles': 0, 'degrees': 2}}) + angles degrees +circle 0 720 +triangle 0 360 +rectangle 0 720 + +>>> df.mul({{'circle': 0, 'triangle': 2, 'rectangle': 3}}, axis='index') + angles degrees +circle 0 0 +triangle 6 360 +rectangle 12 1080 + Multiply a DataFrame of different shape with operator version. >>> other = pd.DataFrame({{'angles': [0, 3, 4]}},