xarray.core.accessor_str.StringAccessor.encode

xarray.core.accessor_str.StringAccessor.encode#

StringAccessor.encode(encoding, errors='strict')[source]#

Encode character string in the array using indicated encoding.

Parameters:
  • encoding (str) – The encoding to use. Please see the Python documentation codecs standard encoders section for a list of encodings handlers.

  • errors (str, default: "strict") – The handler for encoding errors. Please see the Python documentation codecs error handlers for a list of error handlers.

Returns:

encoded (same type as values)