cycquery.ops.CastΒΆ
- class Cast(cols, type_)[source]ΒΆ
Bases:
QueryOp
Cast columns to a specified type.
Currently supporting conversions to str, int, float, date, bool and timestamp.
- Parameters:
Examples
>>> Cast("col1", "str")(table) >>> Cast(["col1", "col2"], "int")(table) >>> Cast("col1", "float")(table) >>> Cast("col1", "date")(table) >>> Cast("col1", "bool")(table) >>> Cast("col1", "timestamp")(table)
Methods