Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix some typos and add polars-business to curated plugin list #11916

Merged
merged 2 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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