Nest: Merge fields into a string record using a layout

class txf.Nest(source, inputs, output[, layout='csv'[, **config]])

The Nest transform combines fields into a single string field using a particular layout. Nest is the logical inverse of Unnest. It is a subclass of Merge.

source: Transform

The input pipeline.

inputs: tuple(str) or str

The fields to combine. They will be dropped from the output, so use Copy to preserve them.

output: str

The output field receiving the merged values. It cannot overwrite existing fields. Use Drop to remove unwanted fields.

layout: str

The layout to generate the output in. Supported layouts are:

  • csv Comma-separated string

  • json, jsonl JavaScript Object Notation string

  • md GitHub Markdown row

  • text The 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')