cudf.core.column.string.StringMethods.istimestamp#

StringMethods.istimestamp(format: str) SeriesOrIndex[source]#

检查每个字符串中的所有字符是否可以使用给定的格式转换为时间戳。

Returns:
Series or Index of bool

与原始Series/Index长度相同的布尔值Series或Index。

示例

>>> import cudf
>>> s = cudf.Series(["20201101", "192011", "18200111", "2120-11-01"])
>>> s.str.istimestamp("%Y%m%d")
0     True
1    False
2     True
3    False
dtype: bool