Esempio n. 1
0
def between(arg, lower, upper):
    """
    Check if the input expr falls between the lower/upper bounds
    passed. Bounds are inclusive. All arguments must be comparable.

    Returns
    -------
    is_between : BooleanValue
    """
    lower = _ops.as_value_expr(lower)
    upper = _ops.as_value_expr(upper)
    op = _ops.Between(arg, lower, upper)
    return op.to_expr()
Esempio n. 2
0
File: api.py Progetto: raderaj/ibis
def between(arg, lower, upper):
    """
    Check if the input expr falls between the lower/upper bounds
    passed. Bounds are inclusive. All arguments must be comparable.

    Returns
    -------
    is_between : BooleanValue
    """
    lower = _ops.as_value_expr(lower)
    upper = _ops.as_value_expr(upper)
    op = _ops.Between(arg, lower, upper)
    return op.to_expr()
Esempio n. 3
0
    def __init__(self, arg, labels, nulls):
        self.arg = ops.as_value_expr(arg)
        self.labels = labels

        card = self.arg.type().cardinality
        if len(self.labels) != card:
            raise ValueError('Number of labels must match number of '
                             'categories: %d' % card)

        self.nulls = nulls
        ir.ValueOp.__init__(self, self.arg, self.labels, self.nulls)
Esempio n. 4
0
    def __init__(self, arg, labels, nulls):
        self.arg = ops.as_value_expr(arg)
        self.labels = labels

        card = self.arg.type().cardinality
        if len(self.labels) != card:
            raise ValueError('Number of labels must match number of '
                             'categories: %d' % card)

        self.nulls = nulls
        ir.ValueNode.__init__(self, self.arg, self.labels, self.nulls)