polars.internals.series.StringNameSpace.decode

StringNameSpace.decode(encoding: str, strict: bool = False) polars.internals.series.Series

Decodes a value using the provided encoding

Parameters
encoding

‘hex’ or ‘base64’

strict

how to handle invalid inputs - True: method will throw error if unable to decode a value - False: unhandled values will be replaced with None

Examples

>>> s = pl.Series(["666f6f", "626172", None])
>>> s.str.decode("hex")
shape: (3,)
Series: '' [str]
[
    "foo"
    "bar"
    null
]