当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Python cudf.core.column.lists.ListMethods.contains用法及代码示例


用法:

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

返回布尔值,指示指定的标量是否是每一行的元素。

参数

search_key标量

在列表列的每一行中搜索的元素

返回

系列或索引

例子

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

相关用法


注:本文由纯净天空筛选整理自rapids.ai大神的英文原创作品 cudf.core.column.lists.ListMethods.contains。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。