cudf.DataFrame.lt#

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

Less than, element-wise (binary operator lt).

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