Return Equal to of series and other, element-wise (binary operator `eq`). Equivalent to ``series == other``, but with support to substitute a fill_value for missing data in either one of the inputs. Parameters ---------- other : object W
(
self,
other,
level: Level | None = None,
fill_value: float | None = None,
axis: Axis = 0,
)
| 6883 | return op(self, other) |
| 6884 | |
| 6885 | def eq( |
| 6886 | self, |
| 6887 | other, |
| 6888 | level: Level | None = None, |
| 6889 | fill_value: float | None = None, |
| 6890 | axis: Axis = 0, |
| 6891 | ) -> Series: |
| 6892 | """ |
| 6893 | Return Equal to of series and other, element-wise (binary operator `eq`). |
| 6894 | |
| 6895 | Equivalent to ``series == other``, but with support to substitute a fill_value |
| 6896 | for missing data in either one of the inputs. |
| 6897 | |
| 6898 | Parameters |
| 6899 | ---------- |
| 6900 | other : object |
| 6901 | When a Series is provided, will align on indexes. For all other types, |
| 6902 | will behave the same as ``==`` but with possibly different results due |
| 6903 | to the other arguments. |
| 6904 | level : int or name |
| 6905 | Broadcast across a level, matching Index values on the |
| 6906 | passed MultiIndex level. |
| 6907 | fill_value : None or float value, default None (NaN) |
| 6908 | Fill existing missing (NaN) values, and any new element needed for |
| 6909 | successful Series alignment, with this value before computation. |
| 6910 | If data in both corresponding Series locations is missing |
| 6911 | the result of filling (at that location) will be missing. |
| 6912 | axis : {0 or 'index'} |
| 6913 | Unused. Parameter needed for compatibility with DataFrame. |
| 6914 | |
| 6915 | Returns |
| 6916 | ------- |
| 6917 | Series |
| 6918 | The result of the operation. |
| 6919 | |
| 6920 | See Also |
| 6921 | -------- |
| 6922 | Series.ge : Return elementwise Greater than or equal to of series and other. |
| 6923 | Series.le : Return elementwise Less than or equal to of series and other. |
| 6924 | Series.gt : Return elementwise Greater than of series and other. |
| 6925 | Series.lt : Return elementwise Less than of series and other. |
| 6926 | |
| 6927 | Examples |
| 6928 | -------- |
| 6929 | >>> a = pd.Series([1, 1, 1, np.nan], index=["a", "b", "c", "d"]) |
| 6930 | >>> a |
| 6931 | a 1.0 |
| 6932 | b 1.0 |
| 6933 | c 1.0 |
| 6934 | d NaN |
| 6935 | dtype: float64 |
| 6936 | >>> b = pd.Series([1, np.nan, 1, np.nan], index=["a", "b", "d", "e"]) |
| 6937 | >>> b |
| 6938 | a 1.0 |
| 6939 | b NaN |
| 6940 | d 1.0 |
| 6941 | e NaN |
| 6942 | dtype: float64 |