Stable non-cryptographic and cryptographic hashing functions for Polars
Project description
This plugin provides stable hashing functionality across different polars versions.
Examples
Cryptographic Hashers
import polars
import polars_hash as plh
df = pl.DataFrame({
"foo":["hello_world"]
})
result = df.select(plh.col('foo').chash.sha256())
print(result)
┌──────────────────────────────────────────────────────────────────┐
│ foo │
│ --- │
│ str │
╞══════════════════════════════════════════════════════════════════╡
│ 35072c1ae546350e0bfa7ab11d49dc6f129e72ccd57ec7eb671225bbd197c8f1 │
└──────────────────────────────────────────────────────────────────┘
Non-cryptographic Hashers
df = pl.DataFrame({
"foo":["hello_world"]
})
result = df.select(plh.col('foo').nchash.wyhash())
print(result)
┌──────────────────────┐
│ foo │
│ --- │
│ u64 │
╞══════════════════════╡
│ 16737367591072095403 │
└──────────────────────┘
Geo Hashers
df = pl.DataFrame(
{"coord": [{"longitude": -120.6623, "latitude": 35.3003}]},
schema={
"coord": pl.Struct(
[pl.Field("longitude", pl.Float64), pl.Field("latitude", pl.Float64)]
),
},
)
df.with_columns(
plh.col('coord').geohash.from_coords().alias('geohash')
)
shape: (1, 2)
┌─────────────────────┬────────────┐
│ coord ┆ geohash │
│ --- ┆ --- │
│ struct[2] ┆ str │
╞═════════════════════╪════════════╡
│ {-120.6623,35.3003} ┆ 9q60y60rhs │
└─────────────────────┴────────────┘
pl.select(pl.lit('9q60y60rhs').geohash.to_coords().alias('coordinates'))
shape: (1, 1)
┌───────────────────────┐
│ coordinates │
│ --- │
│ struct[2] │
╞═══════════════════════╡
│ {-120.6623,35.300298} │
└───────────────────────┘
Create hash from multiple columns
df = pl.DataFrame({
"foo":["hello_world"],
"bar": ["today"]
})
result = df.select(plh.concat_str('foo','bar').chash.sha256())
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
polars_hash-0.4.3.tar.gz
(18.7 kB
view hashes)
Built Distributions
Close
Hashes for polars_hash-0.4.3-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 40c70b9a536d1951e103fc61038d9971245de724fe1f2455fce5e17829f461f9 |
|
MD5 | 9a2e2e9e4d387c7b68d0e3440918db6b |
|
BLAKE2b-256 | 85185feaa21ce62d81c0a7ec87b75f1fa70aa0496da0b839118fb7d09d34d0d2 |
Close
Hashes for polars_hash-0.4.3-cp38-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50e1e38c86c0471a121c987983437cb4772e796a3b5d318ac3f83e6cf59a9e9a |
|
MD5 | 47154374f3b3f882a889e7d752d03083 |
|
BLAKE2b-256 | c2aea356a4e5969fb692f59f3ffb442633fefe37503510098200466810b5d13d |
Close
Hashes for polars_hash-0.4.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41050d9dc7b04538db27b1aa9d4571fe714a422ee55398d90c83212b75b526a0 |
|
MD5 | 85df8f23e9e33ba97e2f367dc3ff70bd |
|
BLAKE2b-256 | 04cbb3fa42558c93e3d9c8e2c178d2fc960642c87a6c086bd48a227f8256662a |
Close
Hashes for polars_hash-0.4.3-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e520fa7c7b2e390c835adfdd3ae8a71e63b96b8ac1267869fbd098204b56f19 |
|
MD5 | 9e17df87b89cfae1920975d7a9c8e85b |
|
BLAKE2b-256 | 52d62729ee7dd024e97e5999e355a2aab0fb0cea2f4a22410b54b2bc0c3ecd42 |
Close
Hashes for polars_hash-0.4.3-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f39b3f363fadf4c547c2ac9e32460aab9de2fedac6f73f6d10cdbc27cb322b12 |
|
MD5 | 686d5359553078b77c0c560a6eb89e94 |
|
BLAKE2b-256 | 8888d5acadc0b8430f767a7ed2c601d76d25ca20f8268d97acf4f24cf7ac6b1c |
Close
Hashes for polars_hash-0.4.3-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a576bd285c0afc2e9f3d89c7143e5d57875792e62540314a023bbf73d51966e |
|
MD5 | d3a7e02f89ec044e58b540753c5b97c8 |
|
BLAKE2b-256 | bdb577b8055971abbb81e39ad69ef214562c43bbec193e5a80e1f82033c30731 |
Close
Hashes for polars_hash-0.4.3-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76cc2db381d5825de7febdbe1ad7f5b7248f8eb5313ff5204d0a7dbb73324926 |
|
MD5 | 63b073e3bb8adf9cefff1a8d0e2cdc3c |
|
BLAKE2b-256 | 1b2468fd32bce2a6c06f5bcc99cbfdfb48578fdf35d9e0cfceac5854e94c788d |
Close
Hashes for polars_hash-0.4.3-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cc25ccf3cfd8bf58fda351aee0271b2794dc1da9fe855b61fb4e616fdf07984 |
|
MD5 | 6ed49aa9ad75a91e9398a8a7dd3ca1f8 |
|
BLAKE2b-256 | 2a28eb8b63dccc45da7892441402c28e1f7ceeb42a6a614d58f969dd55890a9c |
Close
Hashes for polars_hash-0.4.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5266532d38486c7eb3473d17fb45e06d041d9309011b90129f68d65c8073562e |
|
MD5 | ebb39ae8c2a9ceba435136aa65c001b8 |
|
BLAKE2b-256 | 4cc8d7cc3f687756901f462830809418cd06c58e9a7b430436a833c42d9f2ff0 |
Close
Hashes for polars_hash-0.4.3-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f741bee5cb9b63fd2d67b8359f7d71962d3daf149ba7df97ac2d59ec54e16a77 |
|
MD5 | b3da77b95e6621413fa4526353f845cc |
|
BLAKE2b-256 | da01abcc7956a24dffb6b26da690e1bfab6a66939d374949b8ab5f8414977298 |