Skip to content

Commit 2199f34

Browse files
lordgrenvilledatapythonista
authored andcommitted
DOC: Improve docstring of Series.mul (#25136)
1 parent f3f1edd commit 2199f34

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

Diff for: pandas/core/ops.py

+25-3
Original file line numberDiff line numberDiff line change
@@ -459,14 +459,15 @@ def _get_op_name(op, special):
459459
Fill existing missing (NaN) values, and any new element needed for
460460
successful Series alignment, with this value before computation.
461461
If data in both corresponding Series locations is missing
462-
the result will be missing
462+
the result will be missing.
463463
level : int or name
464464
Broadcast across a level, matching Index values on the
465-
passed MultiIndex level
465+
passed MultiIndex level.
466466
467467
Returns
468468
-------
469-
result : Series
469+
Series
470+
The result of the operation.
470471
471472
See Also
472473
--------
@@ -495,6 +496,27 @@ def _get_op_name(op, special):
495496
d 1.0
496497
e NaN
497498
dtype: float64
499+
>>> a.subtract(b, fill_value=0)
500+
a 0.0
501+
b 1.0
502+
c 1.0
503+
d -1.0
504+
e NaN
505+
dtype: float64
506+
>>> a.multiply(b)
507+
a 1.0
508+
b NaN
509+
c NaN
510+
d NaN
511+
e NaN
512+
dtype: float64
513+
>>> a.divide(b, fill_value=0)
514+
a 1.0
515+
b inf
516+
c inf
517+
d 0.0
518+
e NaN
519+
dtype: float64
498520
"""
499521

500522
_arith_doc_FRAME = """

0 commit comments

Comments
 (0)