cycquery.ops.AddDeltaColumnΒΆ
- class AddDeltaColumn(add_to, negative=False, new_col_labels=None, **delta_kwargs)[source]ΒΆ
Bases:
QueryOp
Construct and add an interval column to some columns.
- Parameters:
add_to (
Union
[str
,List
[str
]]) β Column names specifying to which columns is being added.negative (
Optional
[bool
]) β Subtract the object rather than adding.new_col_labels (
Union
[str
,List
[str
],None
]) β If specified, create new columns with these labels. Otherwise, apply the function to the existing columns.**delta_kwargs (
Any
) β The arguments used to create the Interval column.
Examples
>>> AddDeltaColumn("col1", "col2")(table) >>> AddDeltaColumn(["col1", "col2"], "col3")(table) >>> AddDeltaColumn("col1", "col2", negative=True)(table) >>> AddDeltaColumn("col1", "col2", "col1_plus_col2")(table)
Methods