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


Python cudf.core.column.string.StringMethods.is_consonant用法及代码示例


用法:

StringMethods.is_consonant(position) → SeriesOrIndex

对于 position 处的字符是辅音的字符串,返回 true。 position 参数也可以是一个整数列表,用于检查每个字符串的不同字符。如果 position 大于字符串长度,则为该字符串返回 False。

参数

position: int or list-like

在每个字符串中检查的字符位置。

返回

bool dtype 的系列或索引。

例子

>>> import cudf
>>> ser = cudf.Series(["toy", "trouble"])
>>> ser.str.is_consonant(1)
0    False
1     True
dtype: bool
>>> positions = cudf.Series([2, 3])
>>> ser.str.is_consonant(positions)
0     True
1    False
dtype: bool

相关用法


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