FExpr is an object that encapsulates computations to be done on a frame.
FExpr objects are rarely constructed directly (though it is possible too),
instead they are more commonly created as inputs/outputs from various
Consider the following example:
math.sin(2 * f.Angle)
Here accessing column “Angle” in namespace
f creates an
FExpr by a python scalar
2 creates a new
And finally, applying the sine function creates yet another
resulting expression can be applied to a frame via the
DT[i,j] method, which will compute that expression
using the data of that particular frame.
FExpr is a stored computation, which can later be applied to a
Frame, or to multiple frames.
Because of its delayed nature, an
FExpr checks its correctness at the time
when it is applied to a frame, not sooner. In particular, it is possible for
the same expression to work with one frame, but fail with another. In the
example above, the expression may raise an error if there is no column named
“Angle” in the frame, or if the column exists but has non-numeric type.
Most functions in datatable that accept an
FExpr as an input, return
FExpr as an output, thus creating a tree of
FExprs as the
resulting evaluation graph.
Also, all functions that accept
FExprs as arguments, will also accept
certain other python types as an input, essentially converting them into
FExprs. Thus, we will sometimes say that a function accepts FExpr-like
objects as arguments.
All binary operators
op(x, y) listed below work when either
y, or both are