@@ -6122,8 +6122,65 @@ def rmul(self, other, level=None, fill_value=None, axis: Axis = 0) -> Series:
6122
6122
other , roperator .rmul , level = level , fill_value = fill_value , axis = axis
6123
6123
)
6124
6124
6125
- @Appender (ops .make_flex_doc ("truediv" , "series" ))
6126
6125
def truediv (self , other , level = None , fill_value = None , axis : Axis = 0 ) -> Series :
6126
+ """
6127
+ Return Floating division of series and other, \
6128
+ element-wise (binary operator `truediv`).
6129
+
6130
+ Equivalent to ``series / other``, but with support to substitute a
6131
+ fill_value for missing data in either one of the inputs.
6132
+
6133
+ Parameters
6134
+ ----------
6135
+ other : Series or scalar value
6136
+ Series with which to compute division.
6137
+ level : int or name
6138
+ Broadcast across a level, matching Index values on the
6139
+ passed MultiIndex level.
6140
+ fill_value : None or float value, default None (NaN)
6141
+ Fill existing missing (NaN) values, and any new element needed for
6142
+ successful Series alignment, with this value before computation.
6143
+ If data in both corresponding Series locations is missing
6144
+ the result of filling (at that location) will be missing.
6145
+ axis : {0 or 'index'}
6146
+ Unused. Parameter needed for compatibility with DataFrame.
6147
+
6148
+ Returns
6149
+ -------
6150
+ Series
6151
+ The result of the operation.
6152
+
6153
+ See Also
6154
+ --------
6155
+ Series.rtruediv : Reverse of the Floating division operator, see
6156
+ `Python documentation
6157
+ <https://docs.python.org/3/reference/datamodel.html#emulating-numeric-types>`_
6158
+ for more details.
6159
+
6160
+ Examples
6161
+ --------
6162
+ >>> a = pd.Series([1, 1, 1, np.nan], index=["a", "b", "c", "d"])
6163
+ >>> a
6164
+ a 1.0
6165
+ b 1.0
6166
+ c 1.0
6167
+ d NaN
6168
+ dtype: float64
6169
+ >>> b = pd.Series([1, np.nan, 1, np.nan], index=["a", "b", "d", "e"])
6170
+ >>> b
6171
+ a 1.0
6172
+ b NaN
6173
+ d 1.0
6174
+ e NaN
6175
+ dtype: float64
6176
+ >>> a.divide(b, fill_value=0)
6177
+ a 1.0
6178
+ b inf
6179
+ c inf
6180
+ d 0.0
6181
+ e NaN
6182
+ dtype: float64
6183
+ """
6127
6184
return self ._flex_method (
6128
6185
other , operator .truediv , level = level , fill_value = fill_value , axis = axis
6129
6186
)
0 commit comments