From cb7da425256ec947b95152bea90abd5819a79cbb Mon Sep 17 00:00:00 2001 From: Josh Friedlander <16547083+lordgrenville@users.noreply.github.com> Date: Mon, 4 Feb 2019 15:26:07 +0200 Subject: [PATCH] DOC: Improve docstring of Series.mul (#25136) --- pandas/core/ops.py | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/pandas/core/ops.py b/pandas/core/ops.py index 10cebc6f94b925..b3b3b9dd2c20bc 100644 --- a/pandas/core/ops.py +++ b/pandas/core/ops.py @@ -459,14 +459,15 @@ def _get_op_name(op, special): Fill existing missing (NaN) values, and any new element needed for successful Series alignment, with this value before computation. If data in both corresponding Series locations is missing - the result will be missing + the result will be missing. level : int or name Broadcast across a level, matching Index values on the - passed MultiIndex level + passed MultiIndex level. Returns ------- -result : Series +Series + The result of the operation. See Also -------- @@ -495,6 +496,27 @@ def _get_op_name(op, special): d 1.0 e NaN dtype: float64 +>>> a.subtract(b, fill_value=0) +a 0.0 +b 1.0 +c 1.0 +d -1.0 +e NaN +dtype: float64 +>>> a.multiply(b) +a 1.0 +b NaN +c NaN +d NaN +e NaN +dtype: float64 +>>> a.divide(b, fill_value=0) +a 1.0 +b inf +c inf +d 0.0 +e NaN +dtype: float64 """ _arith_doc_FRAME = """