tabsdata.tableframe.expr.expr.Expr.is_between#

Expr.is_between(lower_bound: IntoExpr, upper_bound: IntoExpr, closed: ClosedInterval = 'both') Expr[source]#

If an expression is between the given bounds.

Parameters:
  • lower_bound – The lower bound value.

  • upper_bound – The upper bound value.

  • closed – The interval type, either “both”, “left”, “right”, or “neither”

Example:

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf = tf.select(td.col("temp"), td.col("temp")
>>> .is_between(0, 1).alias("between"))
>>>
┌──────┬─────────┐
│ temp ┆ between │
│ ---  ┆ ------- │
│ f64  ┆ bool    │
╞══════╪═════════╡
│-1.0  ┆  false  │
│ 0.0  ┆  true   │
│ 0.5  ┆  true   │
│ 1.0  ┆  true   │
│ 1.1  ┆  false  │
└──────┴─────────┘