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.0.tar.gz (31.9 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.8+ Windows x86-64

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

Uploaded CPython 3.8+ Windows x86

polars_distance-0.5.0-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.0-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.0-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.0-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.0-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.0-cp38-abi3-macosx_11_0_arm64.whl (5.0 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

polars_distance-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for polars_distance-0.5.0.tar.gz
Algorithm Hash digest
SHA256 a622d3d772c0d35be3d385d3c45f97b870349c05744f9eb6461afb03291657e6
MD5 fd2c7c0fc1d1d6ba41f758db7f1bbf10
BLAKE2b-256 88ed44d9bd24b1f59305d3c4b7afe921d781a3d3c29a7d0302f6c05112e888b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_distance-0.5.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 632b555c0c3adb8a9561013d1a94b0bd749a5f1832d5f4d332f2469499f524d8
MD5 4b8e16bbe5b16e6bbba1a7447e75dcdb
BLAKE2b-256 2958b522043df1683c92a6aebbf93badd622ce6efc2322523eddbef515ae2275

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_distance-0.5.0-cp38-abi3-win32.whl
Algorithm Hash digest
SHA256 5fbf3349926371ca194e9ac35e2d5aee117001464b943c0536b1b36d769c99fb
MD5 bc98f669331a32e79c47120fc248ecbc
BLAKE2b-256 0d2e95404fb584b13c6b8acba8457c767161a570e36e575f64e9f877c1497e74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_distance-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8f3a3a979b8fcc49d67ccd6562c1f6bc0dfc5c28e0afaa2fbdbbe591862b415b
MD5 d8dcad7ab8e20e5ec5fed12a8fbd7ab7
BLAKE2b-256 fea4ea19fa9c46fec9996808cd453d34c270f3bffe387e343338aa163b9b870b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_distance-0.5.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 54d8cbbfd2bbdd1556e59e2089073334b7b95dfbf1221836fb1579cb2d2a90b9
MD5 e994ffbbac00c073b0ac4a2ee44b733c
BLAKE2b-256 0ecc48fdcabce1dd3566113418a380e7725c254b93e21bb2874514c41b95b8c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_distance-0.5.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 b133c58857b0f5ce42bf2c911a07b88716ea6328a81113b0c2eb305af483b5cc
MD5 7c7693c7ead5c2613a27259918911516
BLAKE2b-256 f520ef27204d32ac4b7691a91e5b72c29a79c52aa288508f4cdb47fd5de2436f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_distance-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4fc9a5802ef4f0edf4069c5c10af90511af92f4276c4749f20ed189691d4b6ac
MD5 d38220491efcd9e6863f68a38fd2fe8e
BLAKE2b-256 58b45a757ac7a4dc15f03cab684a27aab5e7425693e8f268adbc71d21e8f8a87

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_distance-0.5.0-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 9928b698f21fbea83080ad320ab06ee9a775bcc0d4ce574d0e655ea3c3d270d9
MD5 31e97163feb25f4ae2575b6f41fb770e
BLAKE2b-256 08037aac8614ea9112a6ba331259ea2f7893b0619efa4a7500d68c81e0e98502

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_distance-0.5.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3c7d6b9400d2c861c7e270696ed8a9160a0faee00e2f59221a61d2dc94167826
MD5 581a2fc75b3b733236088a94da721359
BLAKE2b-256 b8b42ac51784cac26489666711828e29806d255855f2eec023d2f98c471dd62e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polars_distance-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d729b7b266012f8142a562993b8d4bccf7c1ca17f3a5351b6b75d29ef8d3b883
MD5 dd761b628ef5b24530bfca7795a4ea6a
BLAKE2b-256 d928505faf2e14e14a497f25231eaf6532e448b69b002ef85f7dd7512c91728d

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