expressions#

pylibcudf.expressions.ASTOperator#

See also cudf::ast_operator.

Enum members

  • ADD

  • SUB

  • MUL

  • DIV

  • TRUE_DIV

  • FLOOR_DIV

  • MOD

  • PYMOD

  • POW

  • EQUAL

  • NULL_EQUAL

  • NOT_EQUAL

  • LESS

  • GREATER

  • LESS_EQUAL

  • GREATER_EQUAL

  • BITWISE_AND

  • BITWISE_OR

  • BITWISE_XOR

  • NULL_LOGICAL_AND

  • LOGICAL_AND

  • NULL_LOGICAL_OR

  • LOGICAL_OR

  • IDENTITY

  • IS_NULL

  • SIN

  • COS

  • TAN

  • ARCSIN

  • ARCCOS

  • ARCTAN

  • SINH

  • COSH

  • TANH

  • ARCSINH

  • ARCCOSH

  • ARCTANH

  • EXP

  • LOG

  • SQRT

  • CBRT

  • CEIL

  • FLOOR

  • ABS

  • RINT

  • BIT_INVERT

  • NOT

class pylibcudf.expressions.ColumnNameReference#

An expression referring to data from a column in a table.

For details, see cudf::ast::column_name_reference.

Parameters:
column_namestr

Name of this column in the table metadata (provided when the expression is evaluated).

class pylibcudf.expressions.ColumnReference#

An expression referring to data from a column in a table.

For details, see cudf::ast::column_reference.

Parameters:
indexsize_type

The index of this column in the table (provided when the expression is evaluated).

table_sourceTableReference, default TableReferenece.LEFT

Which table to use in cases with two tables (e.g. joins)

class pylibcudf.expressions.Expression#

The base class for all expression types. This class cannot be instantiated directly, please instantiate one of its child classes instead.

For details, see cudf::ast::expression.

class pylibcudf.expressions.Literal#

A literal value used in an abstract syntax tree.

For details, see cudf::ast::literal.

Parameters:
valueScalar

The Scalar value of the Literal. Must be either numeric, string, or a timestamp/duration scalar.

class pylibcudf.expressions.Operation#

An operation expression holds an operator and zero or more operands.

For details, see cudf::ast::operation.

Parameters:
opOperator
leftExpression

Left input expression (left operand)

right: Expression, default None

Right input expression (right operand). You should only pass this if the input expression is a binary operation.

pylibcudf.expressions.TableReference#

See also cudf::table_reference.

Enum members

  • LEFT

  • RIGHT

pylibcudf.expressions.to_expression(unicode expr, tuple column_names)#

Create an expression for pylibcudf.transform.compute_column.

Parameters:
exprstr

The expression to evaluate. In (restricted) Python syntax.

column_namestuple[str]

Ordered tuple of names. When calling compute_column on the resulting expression, the provided table must have columns in the same order as given here.

Returns:
Expression

Expression for the given expr and col_names

Notes

This function keeps a small cache of recently used expressions.