terms.call_resolver.LazyOperator

terms.call_resolver.LazyOperator(op, *args)

Deferred unary or binary operation.

Functions calls like a + b are converted into a LazyOperator that is resolved when you explicitly evaluates it.

Parameters

op : builtin_function_or_method

An operator in the operator built-in module. It can be one of add, pos, sub, neg, pow, mul, and truediv.

args : = ()

One or two lazy instances.

Methods

Name Description
eval Evaluates the operation.

eval

terms.call_resolver.LazyOperator.eval(data_mask, env)

Evaluates the operation.

Evaluates the arguments involved in the operation, calls the Python operator, and returns the result.

Parameters

data_mask : pd.DataFrame

The data frame where variables are taken from

env : Environment

The environment where values and functions are taken from.

Returns

result :

The value obtained from the operator call.