From 8af94b0b8b9c46abacbcfcb31b162019d8ed8a77 Mon Sep 17 00:00:00 2001 From: Ritchie Vink Date: Sat, 21 Oct 2023 11:49:59 +0200 Subject: [PATCH] docs: fix some typos and add polars-business to curated plugin list (#11916) Co-authored-by: Stijn de Gooijer --- docs/user-guide/concepts/lazy-vs-eager.md | 2 +- docs/user-guide/expressions/plugins.md | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/user-guide/concepts/lazy-vs-eager.md b/docs/user-guide/concepts/lazy-vs-eager.md index 1b84a0272aa5..987d07aa8807 100644 --- a/docs/user-guide/concepts/lazy-vs-eager.md +++ b/docs/user-guide/concepts/lazy-vs-eager.md @@ -6,7 +6,7 @@ In this example we use the eager API to: -1. Read the iris [dataset](https://archive.ics.uci.edu/ml/datasets/iris). +1. Read the iris [dataset](https://archive.ics.uci.edu/dataset/53/iris). 1. Filter the dataset based on sepal length 1. Calculate the mean of the sepal width per species diff --git a/docs/user-guide/expressions/plugins.md b/docs/user-guide/expressions/plugins.md index bc39ecfb7eca..3c40ef2b8cf4 100644 --- a/docs/user-guide/expressions/plugins.md +++ b/docs/user-guide/expressions/plugins.md @@ -5,7 +5,7 @@ and register that as an expression into the polars library. The polars engine wi and your expression will run almost as fast as native expressions. Note that this works without any interference of python and thus no GIL contention. -They will benefit from the same benefits default expression have: +They will benefit from the same benefits default expressions have: - Optimization - Parallelism @@ -18,8 +18,8 @@ To get started we will see what is needed to create a custom expression. For our first expression we are going to create a pig latin converter. Pig latin is a silly language where in every word the first letter is removed, added to the back and finally "ay" is added. So the word "pig" would convert to "igpay". -We could of course already do that with expressions, e.g. `col(..) + col(..).str.slice(0, 1) + "ay"`, but a specialized -function for this would perform better and allows us to learn about the plugins. +We could of course already do that with expressions, e.g. `col("name").str.slice(1) + col("name").str.slice(0, 1) + "ay"`, +but a specialized function for this would perform better and allows us to learn about the plugins. ### Setting up @@ -37,9 +37,9 @@ crate-type = ["cdylib"] [dependencies] polars = { version = "*" } -pyo3 = { version = "0.20.0", features = ["extension-module"] } +pyo3 = { version = "*", features = ["extension-module"] } pyo3-polars = { version = "*", features = ["derive"] } -serde = { version = "1", features = ["derive"] } +serde = { version = "*", features = ["derive"] } ``` ### Writing the expression @@ -229,3 +229,9 @@ fn haversine(inputs: &[Series]) -> PolarsResult { ``` That's all you need to know to get started. Take a look at this [repo](https://github.com/pola-rs/pyo3-polars/tree/main/example/derive_expression) to see how this all fits together. + +## Community plugins + +Here is a curated (non-exhaustive) list of community implemented plugins. + +- [polars-business](https://github.com/MarcoGorelli/polars-business) Polars extension offering utilities for business day operations