Nest: Merge fields into a string record using a layout¶
- class txf.Nest(source, inputs, output[, layout='csv'[, **config]])¶
The
Nesttransform combines fields into a single string field using a particular layout.Nestis the logical inverse ofUnnest. It is a subclass ofMerge.- inputs: tuple(str) or str¶
The fields to combine. They will be dropped from the output, so use
Copyto preserve them.
- output: str¶
The output field receiving the merged values. It cannot overwrite existing fields. Use
Dropto remove unwanted fields.
- layout: str¶
The layout to generate the output in. Supported layouts are:
csvComma-separated stringjson,jsonlJavaScript Object Notation stringmdGitHub Markdown rowtextThe Python string representation of the inputs as a list
- config: kwargs¶
Extra arguments to be passed to the layout object.
Usage¶
Nest(p, ('F1', 'F2',) 'CSV', 'csv')
Nest(p, ('Sales 1992', 'Sales 1993',) 'Dict', 'py')