Expressions
Contents
Expressions#
Expression Constructors#
Gets a column from the DataFrame as an Expression ( |
|
Creates an Expression referring to the column with the provided name |
|
Creates an Expression representing a column with every value set to the provided value |
Operators#
Numeric#
Operations on numbers (floats and integers)
Absolute of a numeric expression ( |
|
Adds two numeric expressions or concatenates two string expressions ( |
|
Subtracts two numeric expressions ( |
|
Multiplies two numeric expressions ( |
|
True divides two numeric expressions ( |
|
Takes the mod of two numeric expressions ( |
Logical#
Operations on logical expressions (True/False booleans)
Inverts a boolean expression ( |
|
Takes the logical AND of two boolean expressions ( |
|
Takes the logical OR of two boolean expressions ( |
|
|
Conditionally choose values between two expressions using the current boolean expression as a condition |
Comparisons#
Comparing expressions and values, returning a logical expression
Compares if an expression is less than another ( |
|
Compares if an expression is less than or equal to another ( |
|
Compares if an expression is equal to another ( |
|
Compares if an expression is not equal to another ( |
|
Compares if an expression is greater than another ( |
|
Compares if an expression is greater than or equal to another ( |
|
Checks if values in the Expression are Null (a special value indicating missing data) |
Floats#
Operations on strings, accessible through the Expression.float
method accessor.
Example: e1.float.is_nan()
Access methods that work on columns of floats |
|
|
Checks if values are NaN (a special float value indicating not-a-number) |
Strings#
Operations on strings, accessible through the Expression.str
method accessor.
Example: e1.str.concat(e2)
Access methods that work on columns of strings |
|
|
Concatenates two string expressions together |
|
Checks whether each string contains the given pattern in a string column |
|
Checks whether each string ends with the given pattern in a string column |
|
Checks whether each string starts with the given pattern in a string column |
|
Retrieves the length for a UTF-8 string column |
Dates#
Operations on datetimes, accessible through the Expression.dt
method accessor:
Example: e.dt.day()
Access methods that work on columns of datetimes |
|
|
Retrieves the day for a datetime column |
|
Retrieves the month for a datetime column |
|
Retrieves the year for a datetime column |
|
Retrieves the day of the week for a datetime column, starting at 0 for Monday and ending at 6 for Sunday |
URLs#
Operations on URLs, accessible through the Expression.url
method accessor:
Example: e.url.download()
Access methods that work on columns of URLs |
|
|
Treats each string as a URL, and downloads the bytes contents as a bytes column |
Images#
Operations on images, accessible through the Expression.image
method accessor:
Example: e.image.resize()
Access methods that work on columns of images |
|
|
Resize image into the provided width and height. |
|
Decodes the binary data in this column into images. |
|
Encode an image column as the provided image file format, returning a binary column of encoded bytes. |
Nested#
Operations on nested types (such as List and FixedSizeList), accessible through the Expression.list
method accessor.
Example: e1.list.join(e2)
|
Joins every element of a list using the specified string delimiter |
|
Gets the length of each list |
Changing Column Names/Types#
Gives the expression a new name, which is its column's name in the DataFrame schema and the name by which subsequent expressions can refer to the results of this expression. |
|
Casts an expression to the given datatype if possible |
Running Python Functions#
Apply a function on each value in a given expression |