cudf.core.column.lists.ListMethods.contains#

ListMethods.contains(search_key: Any) Union[cudf.core.series.Series, cudf.core.index.GenericIndex]#

Returns boolean values indicating whether the specified scalar is an element of each row.

Parameters
search_keyscalar

element being searched for in each row of the list column

Returns
Series or Index

Examples

>>> s = cudf.Series([[1, 2, 3], [3, 4, 5], [4, 5, 6]])
>>> s.list.contains(4)
Series([False, True, True])
dtype: bool