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.4.tar.gz
(19.0 kB
view hashes)
Built Distributions
Close
Hashes for polars_hash-0.4.4-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f54550afc846e8b3c99c39d6e8592ba0a32052f2a14808795dabc4d23a61a92f |
|
MD5 | d0124e46aab897637add8f34e4315e69 |
|
BLAKE2b-256 | 2ddd469060b12dd0e4ea784dd2ca1425e929bd028c82f81907773e98338ab909 |
Close
Hashes for polars_hash-0.4.4-cp38-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0563e209c825b6b0b110a9f9dfa8bc86f69d64a8b668a5e2081e7c2e4182248 |
|
MD5 | e5d60bbea547c2f017cea7b784ca1e82 |
|
BLAKE2b-256 | 7d050ca87f60e1bec26757e7722b2f4e5c6d84372bd93712d711778707937c02 |
Close
Hashes for polars_hash-0.4.4-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e405b49de67a6550755817449be5ef7726832a800b034bfecf483b534c1e1ef1 |
|
MD5 | 1f92c24f316d2b3aca01c2fc41f7a484 |
|
BLAKE2b-256 | 478f964ef3d55f750d2adc5d15291269364e54fba5ecac6b73f09ef718e6411f |
Close
Hashes for polars_hash-0.4.4-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6e6f035017100348bfa2ee90a45f386beb5199876f788446a1fc70826d0073a |
|
MD5 | 11237afd81c619bcb606b3c19ed73fe2 |
|
BLAKE2b-256 | d6297a582ab3fe92542f724be22b67eeef94ec82af997b078cd06dd6ce91ad3e |
Close
Hashes for polars_hash-0.4.4-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a2a12d1d7124a7dca28f5aaf4696cd7f847c7168e31fbb0e83d1c11f90be79d |
|
MD5 | 9fd9d46720adc6147f9e1da1f35950d7 |
|
BLAKE2b-256 | c1195f3a93c11326305b4f2d0f7e9e6a484db47a9634019b19eb564b2aed3e42 |
Close
Hashes for polars_hash-0.4.4-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bee8f2639dd9a65e9f23fc09ca6572175a428327b368c8ffa0e5f1c66b2bf2b4 |
|
MD5 | 2999f83157dfbaf51cdf9ae360dd8454 |
|
BLAKE2b-256 | 63f0f1e0d6dda56ee0be9ca7b62b830d9677d2c316730b3d05a7a35b3b8d4c91 |
Close
Hashes for polars_hash-0.4.4-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59f175a224b67984b515fb61c379aa62d84e944582c07666c0cf2c0d134d207f |
|
MD5 | d7edd28d3ce22131f8523c8aa9301307 |
|
BLAKE2b-256 | f4d1c41a337447a7bb866597054357a48515d2cb724b1ba3a2427eedbde8320b |
Close
Hashes for polars_hash-0.4.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da856078ea2d9fa18541f10631f688aa6e8fbe75d060752e65e82b42df23a9c4 |
|
MD5 | 9b2566270a4f854637a060afbfa58dde |
|
BLAKE2b-256 | 78764d8e0f8b54e3715df8e69fbeaef148bd266617430aadc7b4a4c780e6f311 |
Close
Hashes for polars_hash-0.4.4-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9b9fe742ec978213499df42023b748e29bc7f8db683c1d98f8369910f3531f1 |
|
MD5 | 3be55df2603370ff9b2c37c78aeeb7fa |
|
BLAKE2b-256 | bd469a097797a6b6afc68ba568faf01a53f8a90974e132668cd3ed4f1c4d1bdd |
Close
Hashes for polars_hash-0.4.4-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c4737c9c0c742a8087e63b2156f4a48c9a5197cec33cf232e0ccd7e46815437 |
|
MD5 | 1845976e0a6ccfbe8b64ad5b78690337 |
|
BLAKE2b-256 | 7e15f7a4a6540f15a4f8c496e94a1401bab5ff023c618214ec2ba0b45d475b35 |