dask.dataframe.Series.str.decode

dask.dataframe.Series.str.decode#

dataframe.Series.str.decode(encoding, errors: str = 'strict', dtype: str | DtypeObj | None = None)#

Decode character string in the Series/Index using indicated encoding.

This docstring was copied from pandas.core.strings.accessor.StringMethods.decode.

Some inconsistencies with the Dask version may exist.

Equivalent to str.decode() in python2 and bytes.decode() in python3.

Parameters:
encodingstr

Specifies the encoding to be used.

errorsstr, optional

Specifies the error handling scheme. Possible values are those supported by bytes.decode().

dtypestr or dtype, optional

The dtype of the result. When not None, must be either a string or object dtype. When None, the dtype of the result is determined by pd.options.future.infer_string.

Added in version 2.3.0.

Returns:
Series or Index

A Series or Index with decoded strings.

See also

Series.str.encode

Encodes strings into bytes in a Series/Index.

Examples

For Series:

>>> ser = pd.Series([b"cow", b"123", b"()"])
>>> ser.str.decode("ascii")
0   cow
1   123
2   ()
dtype: str