@@ -5957,8 +5957,64 @@ def gt(self, other, level=None, fill_value=None, axis: Axis = 0) -> Series:
5957
5957
other , operator .gt , level = level , fill_value = fill_value , axis = axis
5958
5958
)
5959
5959
5960
- @Appender (ops .make_flex_doc ("add" , "series" ))
5961
5960
def add (self , other , level = None , fill_value = None , axis : Axis = 0 ) -> Series :
5961
+ """
5962
+ Return Addition of series and other, element-wise (binary operator `add`).
5963
+
5964
+ Equivalent to ``series + other``, but with support to substitute a fill_value
5965
+ for missing data in either one of the inputs.
5966
+
5967
+ Parameters
5968
+ ----------
5969
+ other : Series or scalar value
5970
+ With which to compute the addition.
5971
+ level : int or name
5972
+ Broadcast across a level, matching Index values on the
5973
+ passed MultiIndex level.
5974
+ fill_value : None or float value, default None (NaN)
5975
+ Fill existing missing (NaN) values, and any new element needed for
5976
+ successful Series alignment, with this value before computation.
5977
+ If data in both corresponding Series locations is missing
5978
+ the result of filling (at that location) will be missing.
5979
+ axis : {0 or 'index'}
5980
+ Unused. Parameter needed for compatibility with DataFrame.
5981
+
5982
+ Returns
5983
+ -------
5984
+ Series
5985
+ The result of the operation.
5986
+
5987
+ See Also
5988
+ --------
5989
+ Series.radd : Reverse of the Addition operator, see
5990
+ `Python documentation
5991
+ <https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types>`_
5992
+ for more details.
5993
+
5994
+ Examples
5995
+ --------
5996
+ >>> a = pd.Series([1, 1, 1, np.nan], index=["a", "b", "c", "d"])
5997
+ >>> a
5998
+ a 1.0
5999
+ b 1.0
6000
+ c 1.0
6001
+ d NaN
6002
+ dtype: float64
6003
+ >>> b = pd.Series([1, np.nan, 1, np.nan], index=["a", "b", "d", "e"])
6004
+ >>> b
6005
+ a 1.0
6006
+ b NaN
6007
+ d 1.0
6008
+ e NaN
6009
+ dtype: float64
6010
+ >>> a.add(b, fill_value=0)
6011
+ a 2.0
6012
+ b 1.0
6013
+ c 1.0
6014
+ d 1.0
6015
+ e NaN
6016
+ dtype: float64
6017
+ """
5962
6018
return self ._flex_method (
5963
6019
other , operator .add , level = level , fill_value = fill_value , axis = axis
5964
6020
)
0 commit comments