cudf.DataFrame.eq#
- DataFrame.eq(other, axis='columns', level=None, fill_value=None)#
Equal to, element-wise (binary operator eq).
- Parameters
- otherSeries or scalar value
- fill_valueNone or value
Value to fill nulls with before computation. If data in both corresponding Series locations is null the result will be null
- Returns
- Frame
The result of the operation.
Examples
DataFrame
>>> left = cudf.DataFrame({ ... 'a': [1, 2, 3], ... 'b': [4, 5, 6], ... 'c': [7, 8, 9]} ... ) >>> right = cudf.DataFrame({ ... 'a': [1, 2, 3], ... 'b': [4, 5, 6], ... 'd': [10, 12, 12]} ... ) >>> left.eq(right) a b c d 0 True True <NA> <NA> 1 True True <NA> <NA> 2 True True <NA> <NA> >>> left.eq(right, fill_value=7) a b c d 0 True True True False 1 True True False False 2 True True False False
Series
>>> a = cudf.Series([1, 2, 3, None, 10, 20], ... index=['a', 'c', 'd', 'e', 'f', 'g']) >>> a a 1 c 2 d 3 e <NA> f 10 g 20 dtype: int64 >>> b = cudf.Series([-10, 23, -1, None, None], ... index=['a', 'b', 'c', 'd', 'e']) >>> b a -10 b 23 c -1 d <NA> e <NA> dtype: int64 >>> a.eq(b, fill_value=2) a False b False c False d False e <NA> f False g False dtype: bool