Path: blob/main/docs/source/user-guide/expressions/index.md
6940 views
Expressions
We introduced the concept of “expressions” in a previous section. In this section we will focus on exploring the types of expressions that Polars offers. Each section gives an overview of what they do and provides additional examples.
Essentials:
Basic operations – how to do basic operations on dataframe columns, like arithmetic calculations, comparisons, and other common, general-purpose operations
Expression expansion – what is expression expansion and how to use it
Casting – how to convert / cast values to different data types
How to work with specific types of data or data type namespaces:
Strings – how to work with strings and the namespace
str
Lists and arrays – the differences between the data types
List
andArray
, when to use them, and how to use themCategorical data and enums – the differences between the data types
Categorical
andEnum
, when to use them, and how to use themStructs – when to use the data type
Struct
and how to use itMissing data – how to work with missing data and how to fill missing data
Types of operations:
Aggregation – how to work with aggregating contexts like
group_by
Window functions – how to apply window functions over columns in a dataframe
Folds – how to perform arbitrary computations horizontally across columns
User-defined Python functions – how to apply user-defined Python functions to dataframe columns or to column values
Numpy functions – how to use NumPy native functions on Polars dataframes and series