//

ColExpr.__floordiv__(
rhs: ColExpr[Int],
) ColExpr[Int][source]

Integer division //

Warning

The behavior of this operator differs from polars and python. Polars and python always round towards negative infinity, whereas pydiverse.transform always rounds towards zero, regardless of the sign. This behavior matches the one of C, C++ and all currently supported SQL backends.

See also

__mod__

Examples

>>> t = pdt.Table(
...     {
...         "a": [65, -65, 65, -65],
...         "b": [7, 7, -7, -7],
...     }
... )
>>> t >> mutate(r=t.a // t.b) >> show()
shape: (4, 3)
┌─────┬─────┬─────┐
│ a   ┆ b   ┆ r   │
│ --- ┆ --- ┆ --- │
│ i64 ┆ i64 ┆ i64 │
╞═════╪═════╪═════╡
│ 65  ┆ 7   ┆ 9   │
│ -65 ┆ 7   ┆ -9  │
│ 65  ┆ -7  ┆ -9  │
│ -65 ┆ -7  ┆ 9   │
└─────┴─────┴─────┘