Format: Replace a value with a computed value¶
- class txf.Format(source, outputs, function)¶
The
Format
transform reformats the values of a field using a user-supplied function.- input: Transform¶
The name of the string field to apply the function to. The contents will be replaced, so use
Copy
to preserve the original.
- function: callable¶
A Python
callable
that receives the original value and returns the reformatted value.
Usage¶
Format(p, 'Year', lambda x: x+1)