Skip to main content

Polars plugin for pairwise distance functions

Project description

Hellooo :)

This plugin is a work-in progress, main goal is to provide distance metrics on list, arrays and string datatypes.

The docs can be found here: https://ion-elgreco.github.io/polars-distance/

Examples

import polars
import polars_distance as pld

df = pl.DataFrame({
    "foo":"hello",
    "bar":"hella world"
})

df.select(
    pld.col("foo").dist_str.hamming('bar').alias('dist')
)
┌──────┐
 dist 
 ---  
 u32  
╞══════╡
 7    
└──────┘


df.select(
    pld.col('foo').dist_str.levenshtein('bar').alias('dist')
)
┌──────┐
 dist 
 ---  
 u32  
╞══════╡
 6    
└──────┘



df = pl.DataFrame(
    {
        "arr": [[1, 2, 10]],
        "arr2": [[2, 5, 9]],
    },
    schema={
        "arr": pl.Array(inner=pl.Float64, width=3),
        "arr2": pl.Array(inner=pl.Float64, width=3),
    },
)
df.select(pld.col('arr').dist_arr.euclidean('arr2').alias('dist'))
shape: (1, 1)
┌──────────┐
 dist     
 ---      
 f64      
╞══════════╡
 3.316625 
└──────────┘

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polars_distance-0.5.1.tar.gz (35.1 kB view details)

Uploaded Source

Built Distributions

polars_distance-0.5.1-cp38-abi3-win_amd64.whl (5.9 MB view details)

Uploaded CPython 3.8+ Windows x86-64

polars_distance-0.5.1-cp38-abi3-win32.whl (5.4 MB view details)

Uploaded CPython 3.8+ Windows x86

polars_distance-0.5.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

polars_distance-0.5.1-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (6.0 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ppc64le

polars_distance-0.5.1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (6.0 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARMv7l

polars_distance-0.5.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

polars_distance-0.5.1-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (6.0 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.12+ i686

polars_distance-0.5.1-cp38-abi3-macosx_11_0_arm64.whl (4.6 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

polars_distance-0.5.1-cp38-abi3-macosx_10_12_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

Details for the file polars_distance-0.5.1.tar.gz.

File metadata

  • Download URL: polars_distance-0.5.1.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.4

File hashes

Hashes for polars_distance-0.5.1.tar.gz
Algorithm Hash digest
SHA256 a58c6d28799bce1455ff64fc5b3f6a2b22e16157eb651bb54d0303e8cddca618
MD5 fe6f2d9282dd659e884ce2ff3c7519e9
BLAKE2b-256 8c84e69481996022edf68f23e295b271144a5b68d5d35a15d05a57d2b148af8c

See more details on using hashes here.

File details

Details for the file polars_distance-0.5.1-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for polars_distance-0.5.1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 85bf0824f2436d589043e7ec61dc7235c94b85f5620112a9d5de164e2f0f9adb
MD5 9eaaad6e8c9e0be1233149198496fdd8
BLAKE2b-256 46d8cb6f1e28532ef45fdc9c74c2d516d5d2212be93fa2bf583463d1777a6118

See more details on using hashes here.

File details

Details for the file polars_distance-0.5.1-cp38-abi3-win32.whl.

File metadata

File hashes

Hashes for polars_distance-0.5.1-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 72241ee18475882940db87eb6db5423a99221a521db0d89bba93435baa731cef
MD5 2b543897c7fbf61fcc9f56b684ab186c
BLAKE2b-256 386a6c382f271a9f8dd52593bbed6e14c729f2373ee19789b94264bf7a68e276

See more details on using hashes here.

File details

Details for the file polars_distance-0.5.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polars_distance-0.5.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9ef92f8ca90bbb8877491740d5036685b90c6e2d93c2999ea3c01eea57a94de2
MD5 46daef132cd54fb6ff92e4bc004a3be6
BLAKE2b-256 33017cd6b15bbe64bd132151c6d4aae5790da0968c19dba94b31d8e2de0f2454

See more details on using hashes here.

File details

Details for the file polars_distance-0.5.1-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for polars_distance-0.5.1-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 efb6ae7f5326dc476e0ed8bb1cc867fa08633d65dcee6cec3e337c6f8195ab3b
MD5 c77f7ea1667ad87cf31a4ae5e06d2dd8
BLAKE2b-256 92d27fb99f30928e8a4e759caf3e1bd1730eab4bb5a3b94f2b5a7d13f3d37e4b

See more details on using hashes here.

File details

Details for the file polars_distance-0.5.1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for polars_distance-0.5.1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 0a9026b877561c8dee250baa2f05d7d1a19efc30c876781f266139af64dc3d10
MD5 c3450052290bfe3e4a25704543fc86df
BLAKE2b-256 4253e7528174978b5c801cea213b742420250a288a58bcc32ce206c44e67d33f

See more details on using hashes here.

File details

Details for the file polars_distance-0.5.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for polars_distance-0.5.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 74eddddfd26e0057427c6e253a5ecd8898d79bdc3dfb0c317c87e98664464e96
MD5 5e39260938ab4ddc5ef00974aa44d0a1
BLAKE2b-256 819bdcb01695a17e849854c99c048b84c588483c9ffd4d0850bef90fd07aefab

See more details on using hashes here.

File details

Details for the file polars_distance-0.5.1-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for polars_distance-0.5.1-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 481aa5c04664486d8f03fac5a9b0a84de8395ddd284512af31197236937553a9
MD5 f04cb29b8a9d6700e70b4830e0e11e07
BLAKE2b-256 071fbd80e541ac57388d2352353c0fcaf9498fbebc8982e9544091f65d4319a1

See more details on using hashes here.

File details

Details for the file polars_distance-0.5.1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polars_distance-0.5.1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dd9cd988aad63889b4fe779fc0871fa6f495f56cca7f364169ffd54937f8fa47
MD5 af353420a7dce4cbf4ece2467ef9661b
BLAKE2b-256 4e9705cca47437d18647c1ef39ff7fd290ef634343d484ff6364e04f046c0201

See more details on using hashes here.

File details

Details for the file polars_distance-0.5.1-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for polars_distance-0.5.1-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3cfd0d7fa2b456653fad9b9aef4bd78dc16ff0221856691fe27bea239578f833
MD5 738cf04751d2300667b42209d80fda71
BLAKE2b-256 84adaac4f260697150a1416c6da25ef8c2d55b451f37241445513f417b9cf1d7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page