pandas.Series.str.decode#
- Series.str.decode(encoding, errors='strict')[source]#
Decode character string in the Series/Index using indicated encoding.
Equivalent to
str.decode()
in python2 andbytes.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()
.
- 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: object