polars.internals.series.StringNameSpace.lengths

StringNameSpace.lengths() polars.internals.series.Series

Get length of the string values in the Series.

Returns
Series[u32]

Examples

>>> s = pl.Series(["foo", "bar", "hello", "world"])
>>> s.str.lengths()
shape: (4,)
Series: '' [u32]
[
        3
        3
        5
        5
]