Skip to content

Commit

Permalink
docs: fix some typos and add polars-business to curated plugin list (#…
Browse files Browse the repository at this point in the history
…11916)

Co-authored-by: Stijn de Gooijer <[email protected]>
  • Loading branch information
ritchie46 and stinodego authored Oct 21, 2023
1 parent 3251703 commit 8af94b0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/user-guide/concepts/lazy-vs-eager.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
16 changes: 11 additions & 5 deletions docs/user-guide/expressions/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -229,3 +229,9 @@ fn haversine(inputs: &[Series]) -> PolarsResult<Series> {
```

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

0 comments on commit 8af94b0

Please sign in to comment.