Merge: Combine multiple fields into one¶
- class txf.Merge(source, inputs, output[, glue=''])¶
The
Mergetransform combines two or more fields into a single field.Mergecan be used withDivideto 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
Copyto preserve them.
- output: str¶
The output field receiving the merged values. It cannot overwrite existing fields, so use
Dropto 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)