earthkit.data.encoders.text¶
Attributes¶
Classes¶
Encode text data. |
Module Contents¶
- class earthkit.data.encoders.text.TextEncoder(**kwargs)¶
Bases:
earthkit.data.encoders.EncoderEncode text data.
- encode(data=None, target=None, **kwargs)¶
Encode the data.
- Parameters:
data (
obj,None) – The data to encode. Should be used via double dispatch. Must have an_encode()method, which will call the appropriate_encode_*method on theEncoder.values (
obj,None) – The values to encode.check_nans (
bool) – If True, check for NaN values in the data and replace them with themissing_value.metadata (
dict) – Metadata to use when encoding the data. When None, the metadata theEncoderwas created with will be used if available.template (
obj,None) – The template to use to encode the data. When None, the template theEncoderwas created with will be used if available.missing_value (
number) – The value to use for missing values.target (
Target,None) – The target to write to. Can be used by the encoder to determine how to encode the data. When None, the encoder will determine the target from the data to write (if possible) or from theEncoderproperties.**kwargs (
dict) – Additional keyword arguments.
- Returns:
The encoded data.
- Return type:
EncodedData
- metadata¶
- template = None¶
- earthkit.data.encoders.text.encoder¶