cudf.Series.ne#

Series.ne(other, level=None, fill_value=None, axis=0)#

Not equal to, element-wise (binary operator ne).

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.ne(right)
       a      b     c     d
0  False  False  <NA>  <NA>
1  False  False  <NA>  <NA>
2  False  False  <NA>  <NA>
>>> left.ne(right, fill_value=7)
       a      b      c     d
0  False  False  False  True
1  False  False   True  True
2  False  False   True  True

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.ne(b, fill_value=2)
a    True
b    True
c    True
d    True
e    <NA>
f    True
g    True
dtype: bool