@@ -5912,14 +5912,70 @@ def _flex_method(self, other, op, *, level=None, fill_value=None, axis: Axis = 0
5912
5912
5913
5913
return op (self , other )
5914
5914
5915
- @Appender (ops .make_flex_doc ("eq" , "series" ))
5916
5915
def eq (
5917
5916
self ,
5918
5917
other ,
5919
5918
level : Level | None = None ,
5920
5919
fill_value : float | None = None ,
5921
5920
axis : Axis = 0 ,
5922
5921
) -> Series :
5922
+ """
5923
+ Return Equal to of series and other, element-wise (binary operator `eq`).
5924
+
5925
+ Equivalent to ``series == other``, but with support to substitute a fill_value
5926
+ for missing data in either one of the inputs.
5927
+
5928
+ Parameters
5929
+ ----------
5930
+ other : Series or scalar value
5931
+ The second operand in this operation.
5932
+ level : int or name
5933
+ Broadcast across a level, matching Index values on the
5934
+ passed MultiIndex level.
5935
+ fill_value : None or float value, default None (NaN)
5936
+ Fill existing missing (NaN) values, and any new element needed for
5937
+ successful Series alignment, with this value before computation.
5938
+ If data in both corresponding Series locations is missing
5939
+ the result of filling (at that location) will be missing.
5940
+ axis : {0 or 'index'}
5941
+ Unused. Parameter needed for compatibility with DataFrame.
5942
+
5943
+ Returns
5944
+ -------
5945
+ Series
5946
+ The result of the operation.
5947
+
5948
+ See Also
5949
+ --------
5950
+ Series.ge : Return elementwise Greater than or equal to of series and other.
5951
+ Series.le : Return elementwise Less than or equal to of series and other.
5952
+ Series.gt : Return elementwise Greater than of series and other.
5953
+ Series.lt : Return elementwise Less than of series and other.
5954
+
5955
+ Examples
5956
+ --------
5957
+ >>> a = pd.Series([1, 1, 1, np.nan], index=["a", "b", "c", "d"])
5958
+ >>> a
5959
+ a 1.0
5960
+ b 1.0
5961
+ c 1.0
5962
+ d NaN
5963
+ dtype: float64
5964
+ >>> b = pd.Series([1, np.nan, 1, np.nan], index=["a", "b", "d", "e"])
5965
+ >>> b
5966
+ a 1.0
5967
+ b NaN
5968
+ d 1.0
5969
+ e NaN
5970
+ dtype: float64
5971
+ >>> a.eq(b, fill_value=0)
5972
+ a True
5973
+ b False
5974
+ c False
5975
+ d False
5976
+ e False
5977
+ dtype: bool
5978
+ """
5923
5979
return self ._flex_method (
5924
5980
other , operator .eq , level = level , fill_value = fill_value , axis = axis
5925
5981
)
0 commit comments