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.6.tar.gz
(20.5 kB
view hashes)
Built Distributions
Close
Hashes for polars_hash-0.4.6-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a72e2cec9dc768a2469cafcda86e9bafe8eccb607bf248479583de8a323a065a |
|
MD5 | 544fc363047cee77f6713e18a9f21408 |
|
BLAKE2b-256 | 01d210aab2ce773b45b549bafd2efc51b0e72d73b6c7fe5670a6d4661c9db37a |
Close
Hashes for polars_hash-0.4.6-cp38-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b767d0e4b3e5ac6e4182cb0c72c6472efa9805ab87f791dec66eda1aeef0c66 |
|
MD5 | 431ab2057cc9f74cca37e1d06da20aa0 |
|
BLAKE2b-256 | fee11886c8b6e744cc31513be1a5584fd3553c1a75663b2f8087475f80e9d098 |
Close
Hashes for polars_hash-0.4.6-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f62d67f02b80a7d3a6bb74d1dc4578ae3e01455b2944b2ede078c82277f7572a |
|
MD5 | 68eeeaa7925cde06e0d8af2831ae5e79 |
|
BLAKE2b-256 | 899ae46095e7bbabd25e1dbfd9747ee7ce06e0b4af4cfc82b3cea01fbc5861ea |
Close
Hashes for polars_hash-0.4.6-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9defe08c7966bc980a3492a2f9a87808a941f9f5ecf7e0b0cbf4e606276288d5 |
|
MD5 | c1dd2799372d5045bc72c09a425b04a2 |
|
BLAKE2b-256 | 8b2034b52a88cff4e211df0d4afa17bd2f4f3d8c22a1b3ab2cea4a88e9a8618a |
Close
Hashes for polars_hash-0.4.6-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1c6d2a7f4207a8e4ab45c8a535744c393900e2f85e6a46f3e6a92ac82609d39 |
|
MD5 | 844852f5e784f766933b96b17bdd3517 |
|
BLAKE2b-256 | deb5669441b880bb509e15a36876244e529a126fdda616771f9a4a4d8dd057fa |
Close
Hashes for polars_hash-0.4.6-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb064d0528bb894c46678231a1666fc07219f79d345d358f25f304ce07d53399 |
|
MD5 | 895d1696bf3c8083de1989af7327cf24 |
|
BLAKE2b-256 | 28846014adc61731d52e19f4c7a9d0661f14ec0fa53bc66ce2161db1e9d0beed |
Close
Hashes for polars_hash-0.4.6-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2bd965adb054b888a5071351a482653094d786e85d6b14ad15d4db9e9968f6b0 |
|
MD5 | d28a54371e819f217f91db5a9622da31 |
|
BLAKE2b-256 | d9abccb71174506ee044db1a3e140c3fe08e69fa8ab945048a15d904293d8284 |
Close
Hashes for polars_hash-0.4.6-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ab676f5e79326a07c532248e7a7d84e3d5703d4ce7e899c8cb4d440c5574e6c |
|
MD5 | 0cfcc90ad0f85c49f11807089e5d9a61 |
|
BLAKE2b-256 | 6185e8f9f619d3a78f8e7c2748df889fb7403a826ac5c18c40535f6f55fbcb2b |
Close
Hashes for polars_hash-0.4.6-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15fdc569badd1b85cb3750d405db841d861a4d06c7291c8def0d36fa48c8564b |
|
MD5 | 4737c49ad199aaaf353d8953d9033f60 |
|
BLAKE2b-256 | eaed36c2ac816274ca6d4504e816110e011c6e00f18d57dc127b342467c1f68d |
Close
Hashes for polars_hash-0.4.6-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ed6cfaa966222619e6439c740777863132513118c7094ccb053df024b99b334 |
|
MD5 | 085ffb34e8c1bbe910c25905d2d8a3c8 |
|
BLAKE2b-256 | d1a0033499f5472bf123a80fb49a38d4b72e1a27119f536177d8d078c0444ca4 |