tft.coders.CsvCoder
A coder to encode CSV formatted data.
tft.coders.CsvCoder(
column_names,
schema,
delimiter=',',
secondary_delimiter=None,
multivalent_columns=None
)
Args |
column_names
|
Tuple of strings. Order must match the order in the file.
|
schema
|
A Schema proto.
|
delimiter
|
A one-character string used to separate fields.
|
secondary_delimiter
|
A one-character string used to separate values within
the same field.
|
multivalent_columns
|
A list of names for multivalent columns that need to
be split based on secondary delimiter.
|
Raises |
ValueError
|
If schema is invalid.
|
Methods
encode
View source
encode(
instance
)
Encode a tf.transform encoded dict to a csv-formatted string.
Args |
instance
|
A python dictionary where the keys are the column names and the
values are fixed len or var len encoded features.
|
Returns |
A csv-formatted string. The order of the columns is given by column_names.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-11-01 UTC.
[null,null,["Last updated 2024-11-01 UTC."],[],[]]