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.9.tar.gz
(21.9 kB
view hashes)
Built Distributions
Close
Hashes for polars_hash-0.4.9-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a116062a429217f0504ac02ae43b840465520010defdea1bb931deb5051a2c1 |
|
MD5 | ad087e85a876768fb37487e491f947e2 |
|
BLAKE2b-256 | 46a5d8d7edbebba670ef2ad4cf68c84fa7482eb2badfd40f4bc18481f5f6fbbd |
Close
Hashes for polars_hash-0.4.9-cp38-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4293e193d98c0f3456f24cd9e3cca8d51ebd18eff0cacc4d88baa718dba43e1d |
|
MD5 | 687b717edbc6f249cdedae2543b1ccfd |
|
BLAKE2b-256 | 1dfc6f1b5b30e9f5f71dc0e3d5c266d7e6811da97709a0a88894ca86912c8bb5 |
Close
Hashes for polars_hash-0.4.9-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6e5337effbd043ab66aba5ecab269a1c2ccdf90e87bb097127c78aaaa354bdb |
|
MD5 | eb943d78e24839b152b1fc8c69ee05ee |
|
BLAKE2b-256 | f0d2653af41a35f77844be5f9b1729ccd3348902a0df251ea214400af2945449 |
Close
Hashes for polars_hash-0.4.9-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7f373cf6445e482340d2ee78885eceb12fb4502d9161ffe8007c4f0f03334dc |
|
MD5 | 4f50efbc32a86382a69c06c9c1e5fe31 |
|
BLAKE2b-256 | 07c891571f48d7423a38c9c545dc1f6b7c849c8527e0352189baf27560294c91 |
Close
Hashes for polars_hash-0.4.9-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86e52f53531fb88f31f80ce75250e6551099ced22b2d2a1dd199e70eaa0d6f88 |
|
MD5 | 1abaa3173a156c3d09389d99e28e864a |
|
BLAKE2b-256 | b1e6a9879f4f597af9c840ad6e50caa66c2999318746d87abc978456266a2f82 |
Close
Hashes for polars_hash-0.4.9-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec27928eed84b50a3ee0f553ab90be0987bd192c232f5c2033b3061bf2e9fc3e |
|
MD5 | f889a7064e0097f465a65cd5bb9fc643 |
|
BLAKE2b-256 | 5e32cead5efd96e20733bab9ff0f5034d466c24323ec8497a7068670b2c8419b |
Close
Hashes for polars_hash-0.4.9-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eaa46237cc7060842c26bc6b11bb6e4b334a60b8af5fbb8c4fedfc7efcf44528 |
|
MD5 | b7a3a59c012c16165de01c6298689b51 |
|
BLAKE2b-256 | e92387cb60f7bd26074e71045ff9afa7a5736c5841a2a6efdaebea3f4569f12a |
Close
Hashes for polars_hash-0.4.9-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3eff004c13ec89113bc16a0b019fdb821f3baeeafe5f5804ff5842d92eaadd6 |
|
MD5 | d7ab8ddd029528a15f12c8efad797377 |
|
BLAKE2b-256 | 83b08ebf27d02d7240101a3f6873fa49b2944a6b1081b3a00b8a4b89661133c0 |
Close
Hashes for polars_hash-0.4.9-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 619c037380d9497fec7c3ee00f4b65c9485420c3f5fdecb84c919b80fbecfd5d |
|
MD5 | ee1efe0fc534474667f287ac5ffefdb6 |
|
BLAKE2b-256 | 06b51b8503b091816e5aedc216558b9da868f598974815e39e9b412ca799855e |
Close
Hashes for polars_hash-0.4.9-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 523caaf07e580d22f53735e8e9bd7369963c8d7ff32e4f9d81f45d61c2c5bf17 |
|
MD5 | 6ff6baf1322eda382f8587fce94ce442 |
|
BLAKE2b-256 | 3726bbf400b7ae3ef589424890df78c24b63b934bdeeac6d92e86b39e5bffd69 |