cycquery.ops.ConditionInΒΆ
- class ConditionIn(col, values, not_=False, binarize_col=None, **cond_kwargs)[source]ΒΆ
Bases:
QueryOp
Filter rows based on having a value in list of values.
- Parameters:
col (
str
) β Column name on which to condition.values (
Union
[Any
,List
[Any
]]) β Values in which the column value must be.not β Take negation of condition.
binarize_col (
Optional
[str
]) β If specified, create a Boolean column of name binarize_col instead of filtering.**cond_kwargs (
Any
) β Optional keyword arguments for processing the condition.
Examples
>>> ConditionIn("col1", [1, 2])(table) >>> ConditionIn("col1", [1, 2], binarize_col="col1_bool")(table)
Methods