pandas.Series.str.encode

Series.str.encode(encoding, errors='strict')

Encode character string in the Series/Index to some other encoding using indicated encoding. Equivalent to str.encode().

Parameters:

encoding : string

errors : string

Returns:

encoded : Series/Index of objects