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
Built Distributions
File details
Details for the file polars_hash-0.5.0.tar.gz
.
File metadata
- Download URL: polars_hash-0.5.0.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3f053299ab79269a3f1911e1ae5c6f46119e26435882af728ad86915d3999d1 |
|
MD5 | b6ae79294d1c84751ac7eb8c54672ff1 |
|
BLAKE2b-256 | 821aff87a08adc29cf12ba68564495dfff8db52a0142d0a48caa7b27ba5d7ca9 |
File details
Details for the file polars_hash-0.5.0-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: polars_hash-0.5.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 3.7 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2d10c4ac757d48df6e6cdeca4cd3e0aaace19ad6b3e82409c337ad1709137a2 |
|
MD5 | c1e03e60f779b35febb65e479b20da6a |
|
BLAKE2b-256 | 7f37390c37fbdde14d049aaa4cb5dd3b8326e389ad1e6becb597b55ca4449299 |
File details
Details for the file polars_hash-0.5.0-cp38-abi3-win32.whl
.
File metadata
- Download URL: polars_hash-0.5.0-cp38-abi3-win32.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.8+, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e5be1c47c90c28220b9ee380ae4be7343a19edb5a00bd22fd9ac11a1e4e3ca2 |
|
MD5 | 3eb2d15f04e305007f47185ecdfa1382 |
|
BLAKE2b-256 | 7fadc3825d5a2502095acf3ecc7a8007a9ed53169a03dc93052dec52e3d76f6d |
File details
Details for the file polars_hash-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: polars_hash-0.5.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.5 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c46a18950a3eee3ead5073a6e7728f7641762d49bf6e70eb5d690e9c1815fe4 |
|
MD5 | 2f40389c924894724d79f7207dfdacce |
|
BLAKE2b-256 | 9179f2f990e5db8118b1cdafdeda6137d6f469fb1327ede1698cd98426f3cc83 |
File details
Details for the file polars_hash-0.5.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
.
File metadata
- Download URL: polars_hash-0.5.0-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 4.5 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9407fc0c42b881ade1591c14b041d6f3213535aaaa6e2df39811a894e8550d47 |
|
MD5 | 69101a72d07939b7b652bbff0e4951b0 |
|
BLAKE2b-256 | c89059204944e2fbcbf296f3de8cdc674b1df04a08ffa75dde9ccd6e4e97c453 |
File details
Details for the file polars_hash-0.5.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
.
File metadata
- Download URL: polars_hash-0.5.0-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c488268b05267da90212ca6a3c89dab11e0ba8c4332fbf6d9586fc9d5de7c6f0 |
|
MD5 | 69f3cf7c0499ad0776ae01ac11e9e357 |
|
BLAKE2b-256 | 36298af9df94eb5766f95ff9270351f8836e9952ad3def70469f3686cd721475 |
File details
Details for the file polars_hash-0.5.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
.
File metadata
- Download URL: polars_hash-0.5.0-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 4.2 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdf2af9e1aa0bbfd3833fba8c452bb36e504cff65415501b7d8950172d4222ba |
|
MD5 | 387f95b3c121caa981e5587c649b31fd |
|
BLAKE2b-256 | 5a13803f1e5a7e9fa565dfa445667369b395285f9f9df9a08827f6e0800ba70a |
File details
Details for the file polars_hash-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: polars_hash-0.5.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa294e8328ab508a342e6c9cdd5a187e9fec851f9ebf8a4d8c18cdc5490c57b7 |
|
MD5 | 41562ac7e36b29eee7c550f299b370a3 |
|
BLAKE2b-256 | dd9833705872d21e04fe2438544dc8dcd77abd172c4fe82b593b7dee07c34433 |
File details
Details for the file polars_hash-0.5.0-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: polars_hash-0.5.0-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.6 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2c2a4bef51b0e8582b1389b8d6b66817e244e4c61d163dac8896aaf9910e44c |
|
MD5 | e16cabdf15a4169725a79f12057929dd |
|
BLAKE2b-256 | 5162fde9d8b34be8a1b78b53a3df27053749e0a7fabc8f5f37c82d3d9152450e |
File details
Details for the file polars_hash-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: polars_hash-0.5.0-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af71ed5ecd2f1efba1badbe0f77430150e34d77f3315bab4bda7f567a026a902 |
|
MD5 | d77719cb326935304ae6e1b373942b28 |
|
BLAKE2b-256 | cf66eee55fbabc1e2339622ca034bd8d3b5c7df031491189671abdfeec7f1767 |