List-oriented math and expression helpers for Polars.
Project description
polars-list-math
polars-list-math is a Python/Rust package with list-oriented expression
helpers for Polars.
Import the package once to register extra methods on Expr.list:
import polars as pl
import polars_list_math # noqa: F401
Install
pip install polars-list-math
# or
uv add polars-list-math
Requires Python 3.12+ and polars>=1.39.3.
Methods
| Method | Result | Docs |
|---|---|---|
Expr.list.zip(...) |
Zip lists into list[struct] |
Polars proposal |
Expr.list.combinations(...) |
Pair each item with itself and later items in the same list | Combinations |
Expr.list.combinations_to(...) |
Pair each item with each item from another list | Combinations |
Expr.list.similarity(...) |
Weighted similarity between two lists | Similarity |
Expr.list.mean_similarity(...) |
Mean similarity inside a nested-list row | Similarity |
Expr.list.mean_similarity_to(...) |
Mean similarity to reference nested lists | Similarity |
The Python helper py_list_similarity(...) computes the same weighted
similarity for plain Python sequences.
If a future Polars release ships native methods with the same names, this package leaves the native implementation untouched.
Quick Examples
df = pl.DataFrame(
{
"a": [[1, 2, 3]],
"b": [[2, 1, 3]],
"groups": [[[1, 2, 3], [1, 2, 3], [4, 5, 6]]],
}
)
df.with_columns(
pl.col("a").list.similarity("b").alias("similarity"),
pl.col("groups").list.mean_similarity().alias("mean_similarity"),
pl.col("a").list.combinations().alias("pairs"),
pl.col("a").list.zip("b", fields=["a", "b"]).alias("zipped"),
)
Development
make install
make develop
make test
Build and check the package locally:
make check-dist
Release steps are in docs/publishing.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polars_list_math-0.1.1.tar.gz.
File metadata
- Download URL: polars_list_math-0.1.1.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1dd10ffc8650e041a3ea22583b04dc43ded4d944881718e4b0baafb097ecf4bb
|
|
| MD5 |
1f11020556f0ce48274405605878944b
|
|
| BLAKE2b-256 |
e2c32fc0af1cb58383b4a2fcb270ee1065c894e452d82e955e831e6e66ceade7
|
Provenance
The following attestation bundles were made for polars_list_math-0.1.1.tar.gz:
Publisher:
publish.yml on rufrozen/polars-list-math
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_list_math-0.1.1.tar.gz -
Subject digest:
1dd10ffc8650e041a3ea22583b04dc43ded4d944881718e4b0baafb097ecf4bb - Sigstore transparency entry: 2221070179
- Sigstore integration time:
-
Permalink:
rufrozen/polars-list-math@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/rufrozen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file polars_list_math-0.1.1-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: polars_list_math-0.1.1-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 4.8 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0d90c599a6ae00eb622ecf5397d92b5da6013f17ad72b5101ea0fc5b90631f8
|
|
| MD5 |
e82d65619bc84b2db385c2b9011c59ab
|
|
| BLAKE2b-256 |
c508925895c63ea1aeaa908954187a9339fedf28285166c23902abf3c72154eb
|
Provenance
The following attestation bundles were made for polars_list_math-0.1.1-cp313-cp313-win_amd64.whl:
Publisher:
publish.yml on rufrozen/polars-list-math
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_list_math-0.1.1-cp313-cp313-win_amd64.whl -
Subject digest:
c0d90c599a6ae00eb622ecf5397d92b5da6013f17ad72b5101ea0fc5b90631f8 - Sigstore transparency entry: 2221072459
- Sigstore integration time:
-
Permalink:
rufrozen/polars-list-math@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/rufrozen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file polars_list_math-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: polars_list_math-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.2 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c19b36583fbecbafac1fda813ebebccd75665096919d90d44f8d0185f15d96f4
|
|
| MD5 |
5bcdb4f911e9d3deb4c680118d37add1
|
|
| BLAKE2b-256 |
d8a195691ea1dcbcce26f4d674c24111a7755a374516c6b02fe135f027ecfbf8
|
Provenance
The following attestation bundles were made for polars_list_math-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on rufrozen/polars-list-math
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_list_math-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
c19b36583fbecbafac1fda813ebebccd75665096919d90d44f8d0185f15d96f4 - Sigstore transparency entry: 2221072824
- Sigstore integration time:
-
Permalink:
rufrozen/polars-list-math@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/rufrozen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file polars_list_math-0.1.1-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: polars_list_math-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59b291b99a4e55661bf377dcfe5a488ecd3319f7c532f116f8f59c9771fd84fe
|
|
| MD5 |
effa4bf9994e49458ce5124b5a4e1964
|
|
| BLAKE2b-256 |
1fb6aba35724a14d2cf88c8b60e7587a535d70d627fafe338389ce979c0b9a0c
|
Provenance
The following attestation bundles were made for polars_list_math-0.1.1-cp313-cp313-macosx_11_0_arm64.whl:
Publisher:
publish.yml on rufrozen/polars-list-math
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_list_math-0.1.1-cp313-cp313-macosx_11_0_arm64.whl -
Subject digest:
59b291b99a4e55661bf377dcfe5a488ecd3319f7c532f116f8f59c9771fd84fe - Sigstore transparency entry: 2221071805
- Sigstore integration time:
-
Permalink:
rufrozen/polars-list-math@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/rufrozen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file polars_list_math-0.1.1-cp313-cp313-macosx_10_12_x86_64.whl.
File metadata
- Download URL: polars_list_math-0.1.1-cp313-cp313-macosx_10_12_x86_64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.13, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
776497f6341630f4b0dc0dd590db8bf5f4bf424333d7f5a6c433e372ebb6f11a
|
|
| MD5 |
6b1b0e30f36685281e49c9bd6dd1ccf6
|
|
| BLAKE2b-256 |
e2940bd2172938df44269cfd44297c7d04a0d381516cc473346de4912003ca0f
|
Provenance
The following attestation bundles were made for polars_list_math-0.1.1-cp313-cp313-macosx_10_12_x86_64.whl:
Publisher:
publish.yml on rufrozen/polars-list-math
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_list_math-0.1.1-cp313-cp313-macosx_10_12_x86_64.whl -
Subject digest:
776497f6341630f4b0dc0dd590db8bf5f4bf424333d7f5a6c433e372ebb6f11a - Sigstore transparency entry: 2221070633
- Sigstore integration time:
-
Permalink:
rufrozen/polars-list-math@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/rufrozen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file polars_list_math-0.1.1-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: polars_list_math-0.1.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 4.8 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a970a09b1e457456b7ab7ad4eec38b81dd30ee219580d3da575a885aaef9d857
|
|
| MD5 |
2c8f52a9d018bc2f059647025574a0dd
|
|
| BLAKE2b-256 |
0bc525eebfe2bcb4e2a832934d37f3b508f9a4ca757982d8dd60b516655e4249
|
Provenance
The following attestation bundles were made for polars_list_math-0.1.1-cp312-cp312-win_amd64.whl:
Publisher:
publish.yml on rufrozen/polars-list-math
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_list_math-0.1.1-cp312-cp312-win_amd64.whl -
Subject digest:
a970a09b1e457456b7ab7ad4eec38b81dd30ee219580d3da575a885aaef9d857 - Sigstore transparency entry: 2221072290
- Sigstore integration time:
-
Permalink:
rufrozen/polars-list-math@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/rufrozen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file polars_list_math-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: polars_list_math-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.2 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9dd52383a2a398bc769a1fa1d6e57d09ecf2648e05b60a5f1f2424fd88d1d3a
|
|
| MD5 |
d2c47613ec3f67d57a8e6f08fc522f4e
|
|
| BLAKE2b-256 |
a5e6da7c741adf9a22c4ed303448808fd5460e58b783d25982fdca063e023b8f
|
Provenance
The following attestation bundles were made for polars_list_math-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on rufrozen/polars-list-math
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_list_math-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
f9dd52383a2a398bc769a1fa1d6e57d09ecf2648e05b60a5f1f2424fd88d1d3a - Sigstore transparency entry: 2221071458
- Sigstore integration time:
-
Permalink:
rufrozen/polars-list-math@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/rufrozen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file polars_list_math-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: polars_list_math-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28c9eaddf5599f34c749736a1d56cc7ab31255ffabd90d9d118f0c6018eeeb9d
|
|
| MD5 |
d39c2fec20aff40e0910c9d87acb5378
|
|
| BLAKE2b-256 |
8a729529100e23d236af324ca2b376d19e9dfb40e52cacb6de874f6c0aa607ba
|
Provenance
The following attestation bundles were made for polars_list_math-0.1.1-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
publish.yml on rufrozen/polars-list-math
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_list_math-0.1.1-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
28c9eaddf5599f34c749736a1d56cc7ab31255ffabd90d9d118f0c6018eeeb9d - Sigstore transparency entry: 2221071139
- Sigstore integration time:
-
Permalink:
rufrozen/polars-list-math@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/rufrozen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file polars_list_math-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl.
File metadata
- Download URL: polars_list_math-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.12, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
475e57281f94eaa9f7b76341096c0b59adeebb558be6c9ddc260ed13caa9d1f8
|
|
| MD5 |
9cfd9cf77b4fa70cff82d5aaf61c388b
|
|
| BLAKE2b-256 |
f4fb790420f32768ce8a63624ee6d73a4622a0bc4384ecd6759cc3f78fcedefe
|
Provenance
The following attestation bundles were made for polars_list_math-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl:
Publisher:
publish.yml on rufrozen/polars-list-math
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
polars_list_math-0.1.1-cp312-cp312-macosx_10_12_x86_64.whl -
Subject digest:
475e57281f94eaa9f7b76341096c0b59adeebb558be6c9ddc260ed13caa9d1f8 - Sigstore transparency entry: 2221072081
- Sigstore integration time:
-
Permalink:
rufrozen/polars-list-math@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/rufrozen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f893c17e4ab181f00b06ce94890c47a0baf7f2f3 -
Trigger Event:
push
-
Statement type: