cudf.DataFrame.gt#

DataFrame.gt(other, axis='columns', level=None, fill_value=None)#

Greater than, element-wise (binary operator gt).

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.gt(right)
       a      b     c     d
0  False  False  <NA>  <NA>
1  False  False  <NA>  <NA>
2  False  False  <NA>  <NA>
>>> left.gt(right, fill_value=7)
       a      b      c      d
0  False  False  False  False
1  False  False   True  False
2  False  False   True  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.gt(b)
a     True
b    False
c     True
d    False
e    False
f    False
g    False
dtype: bool