cudf.core.column.string.StringMethods.isalnum#
- StringMethods.isalnum() SeriesOrIndex[source]#
检查每个字符串中的所有字符是否都是字母数字。
这相当于对Series/Index中的每个元素运行Python字符串方法 str.isalnum()。 如果一个字符串有零个字符,则对该检查返回False。
等同于:
isalpha() or isdigit() or isnumeric() or isdecimal()- Returns:
- Series or Index of bool
与原始Series/Index长度相同的布尔值Series或Index。
另请参阅
示例
>>> import cudf >>> s1 = cudf.Series(['one', 'one1', '1', '']) >>> s1.str.isalnum() 0 True 1 True 2 True 3 False dtype: bool
请注意,对于字母数字检查,与任何额外的标点符号或空白字符混合的字符检查将评估为false。
>>> s2 = cudf.Series(['A B', '1.5', '3,000']) >>> s2.str.isalnum() 0 False 1 False 2 False dtype: bool