Merge: Combine multiple fields into one¶
- class txf.Merge(source, inputs, output[, glue=''])¶
The
Merge
transform combines two or more fields into a single field.Merge
can be used withDivide
to combine field variants that have been reformatted separately into a single representation- inputs: tuple(str), 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, so use
Drop
to remove unwanted fields.
- glue: str or callable¶
Either a string used to join the input values, or a callable. If the glue is a callable, it will be given the values of inputs as positional arguments in the given order. It should return the merged value.
Usage¶
Merge(p, ('US Date', 'UK Date',) 'Date', '')
Merge(p, ('Sales 1992', 'Sales 1993',) 'Sales', operator.add)