Skip to content

pd.Series.str.encode

Link to Pandas documentation

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

Argument Restrictions:

  • encoding: must be type String.
  • errors: must be type String.

Note

Input must be a Series of String data.

Example Usage

>>> @bodo.jit
... def f(S):
...     return S.str.encode("ascii")
>>> S = pd.Series(["A", "ce", "14", " ", "@", "a n", "^ Ef"])
>>> f(S)
0       b'A'
1      b'ce'
2      b'14'
3       b' '
4       b'@'
5     b'a n'
6    b'^ Ef'
dtype: object