%¶
- ColExpr.__mod__( ) ColExpr[Int][source]¶
The remainder of integer division %
Warning
This operator behaves differently than in polars. There are at least two conventions how % and // should behave for negative inputs. We follow the one that C, C++ and all currently supported SQL backends follow. This means that the output has the same sign as the left hand side of the input, regardless of the right hand side.
See also
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 ┆ 2 │ │ -65 ┆ 7 ┆ -2 │ │ 65 ┆ -7 ┆ 2 │ │ -65 ┆ -7 ┆ -2 │ └─────┴─────┴─────┘