cudf.core.column.string.StringMethods.len#

StringMethods.len() SeriesOrIndex#

Computes the length of each element in the Series/Index.

Returns:
Series or Index of int

A Series or Index of integer values indicating the length of each element in the Series or Index.

Examples

>>> import cudf
>>> s = cudf.Series(["dog", "", "\n", None])
>>> s.str.len()
0       3
1       0
2       1
3    <NA>
dtype: int32