From 92feac4bb5b0066b6f749fcf296e0d6a51aa4b2c Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Wed, 28 Feb 2024 20:36:46 +0000 Subject: [PATCH 1/3] correct expressions definition --- docs/user-guide/concepts/expressions.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/user-guide/concepts/expressions.md b/docs/user-guide/concepts/expressions.md index add9e03d560b..cdc252313f7d 100644 --- a/docs/user-guide/concepts/expressions.md +++ b/docs/user-guide/concepts/expressions.md @@ -21,7 +21,10 @@ Polars performs these core data transformations very quickly by: - automatic query optimization on each expression - automatic parallelization of expressions on many columns -Polars expressions are a mapping from a series to a series (or mathematically `Fn(Series) -> Series`). As expressions have a `Series` as an input and a `Series` as an output then it is straightforward to do a sequence of expressions (similar to method chaining in pandas). +Polars expressions are a mapping from a dataframe to a series (or mathematically `Fn(DataFrame) -> Series`). As expressions have a `Series` as output then it is straightforward to do a sequence of expressions (similar to method chaining in pandas) which just keep transforming the output `Series` from the previous step. + +If this seems abstract and confusing - don't worry! People quickly develop an intuition for expressions +just by looking at a few examples. We'll do that next! ## Examples From 5f648b9ada8a7aced647aace0b47139544b77eaa Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sun, 3 Mar 2024 18:00:42 +0000 Subject: [PATCH 2/3] use definition from definitive guide --- docs/user-guide/concepts/expressions.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/user-guide/concepts/expressions.md b/docs/user-guide/concepts/expressions.md index cdc252313f7d..fa3503aa314e 100644 --- a/docs/user-guide/concepts/expressions.md +++ b/docs/user-guide/concepts/expressions.md @@ -21,7 +21,10 @@ Polars performs these core data transformations very quickly by: - automatic query optimization on each expression - automatic parallelization of expressions on many columns -Polars expressions are a mapping from a dataframe to a series (or mathematically `Fn(DataFrame) -> Series`). As expressions have a `Series` as output then it is straightforward to do a sequence of expressions (similar to method chaining in pandas) which just keep transforming the output `Series` from the previous step. +An expression is a tree of operations that describe how to construct one or more +Series. As the output is one or more Series, it is straightforward to +apply a sequence of expressions (similar to method chaining in pandas) each of which +transforms the output Series from the previous step. If this seems abstract and confusing - don't worry! People quickly develop an intuition for expressions just by looking at a few examples. We'll do that next! From 6160f68066d5ece156f08fe35c24dbfac8c606b7 Mon Sep 17 00:00:00 2001 From: Marco Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Sun, 3 Mar 2024 18:02:55 +0000 Subject: [PATCH 3/3] reduce --- docs/user-guide/concepts/expressions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/user-guide/concepts/expressions.md b/docs/user-guide/concepts/expressions.md index fa3503aa314e..9b857bb90aa0 100644 --- a/docs/user-guide/concepts/expressions.md +++ b/docs/user-guide/concepts/expressions.md @@ -22,9 +22,9 @@ Polars performs these core data transformations very quickly by: - automatic parallelization of expressions on many columns An expression is a tree of operations that describe how to construct one or more -Series. As the output is one or more Series, it is straightforward to +Series. As the outputs are Series, it is straightforward to apply a sequence of expressions (similar to method chaining in pandas) each of which -transforms the output Series from the previous step. +transforms the output from the previous step. If this seems abstract and confusing - don't worry! People quickly develop an intuition for expressions just by looking at a few examples. We'll do that next!