Fill: Fill in missing values by copying down

class txf.Fill(source, input[, default=''[, blank='']])

The Fill (or FillDown) transform fills in blank values by using the most recent value for the field. Fill is a subclass of Format because it effectively reformats a field.

source: Transform

The input pipeline.

input: str

The name of the field to fill in. The contents will be replaced, so use Copy to preserve the original.

default: any

The value to use when there is no most recent value (e.g, at the top of the file). It needs to match the type of the field.

blank: any

The value to use to determine “blankness” (e.g., for non-string fields it might be 0 or None).

Usage

Fill(p, 'State')
Fill(p, 'Amount', 0.0, 0.0)

Example

Query

Run

Branch

|| Q01_PARALLEL ||

master

Cold run…DONE

master

1/5…0.083052

master

2/5…0.079075

master

3/5…0.079176

master

4/5…0.078928

master

5/5…0.079142

master

Fill(p, 'Query', 'Q00')

Query

Run

Branch

|| Q01_PARALLEL ||

master

|| Q01_PARALLEL ||

Cold run…DONE

master

|| Q01_PARALLEL ||

1/5…0.083052

master

|| Q01_PARALLEL ||

2/5…0.079075

master

|| Q01_PARALLEL ||

3/5…0.079176

master

|| Q01_PARALLEL ||

4/5…0.078928

master

|| Q01_PARALLEL ||

5/5…0.079142

master