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.8.tar.gz
(22.1 kB
view hashes)
Built Distributions
Close
Hashes for polars_hash-0.4.8-cp38-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d406db06261159e209f4b5a41fb558610658c19076532f854805e5f70d21fa9 |
|
MD5 | 154b366be1af6488eaf0465489f911c4 |
|
BLAKE2b-256 | 99de09c6a652f3c677f4690a3c4348c64ade231b1c169fbe154e20d16c031de7 |
Close
Hashes for polars_hash-0.4.8-cp38-abi3-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbc936f29920f6bbce404f072765e18bb827b803f8486a11f57eea7acc894e92 |
|
MD5 | 7f901103fc80fa389903d4040d248e05 |
|
BLAKE2b-256 | 7d7e02b9c726a064208ebee53edb4702630d1696d63518363e9d79f47467e9cb |
Close
Hashes for polars_hash-0.4.8-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df6fa117b648855695ca1284c890fd16c989f3346fb080211f095d25a5cb92a0 |
|
MD5 | cf1729d15fa0ed4f1bafb56a46eea2c7 |
|
BLAKE2b-256 | 287364fb761ceecffd0dac3e7677e0b9623c824c55c5c75247fda0699b7174f7 |
Close
Hashes for polars_hash-0.4.8-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c3ce44300a3fa571a2b37638b7c86417aabf63b620a2080d82c8c793b659a0a |
|
MD5 | baae63f0b5c29798992b684bc058eff4 |
|
BLAKE2b-256 | 10188d2732bad2904dd220cc2e4506330ec0ae9dc2f76a33b3a8ad4f26f1101e |
Close
Hashes for polars_hash-0.4.8-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0876837964a8402b6800959f56bbf46c208f1ce4193c0d5ea050ede44cbd859 |
|
MD5 | f5b291c0cffe2ff2319d65ded33b6702 |
|
BLAKE2b-256 | 59ccf9dfbcfb9db55d4a1a38abe83edcd74d5f9a1e9d309727ca09d17abba6ee |
Close
Hashes for polars_hash-0.4.8-cp38-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 942292b5b4eee979e2b2a57050848de2529e14142efbdcbc9e52e8f2a594e927 |
|
MD5 | 26ef94d3b29faf6645dbfbd1b193c96a |
|
BLAKE2b-256 | 1d7c8775844ec6d6d42f0a1e44658cdc3b4e89b3f9bd560be9abf06ddb89d92e |
Close
Hashes for polars_hash-0.4.8-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac6eb5e4110fccce6ae8e80837d0d77356b262b3f0eb2108dce932713f440e35 |
|
MD5 | 221d9f5e536b686e6edfb2726fc10271 |
|
BLAKE2b-256 | 3f233891b78b5410f1dc9c1d18f9d833c96202d77d06d03283c9adbcd9fe7a65 |
Close
Hashes for polars_hash-0.4.8-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b09e9ca9a7885da54e914d92f0eea6d4a9df03ffb73b1134bd1856a7c9742ed |
|
MD5 | e7c20cdf845bce3a5ed58ce6c070811a |
|
BLAKE2b-256 | d884c9674c5e9e50476058004b87c04bcf24c1b33f2d6184c45ea607c179a3f1 |
Close
Hashes for polars_hash-0.4.8-cp38-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd68ccd8b934e8abe70d082518a8e02ce8b0a914b3fa337e2fbbbcce788d33b1 |
|
MD5 | 2c8e2d9ad0fa4ec279b4549833d328e4 |
|
BLAKE2b-256 | 8f86f2cfe70ba77958bcc96fb27831dab4c9b5a52f9f44e3dc20a76858e5ed6d |
Close
Hashes for polars_hash-0.4.8-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22f8cc78f4775a40f3a03e3503c484ce5d411d9756dc2b7cc37919a348ff8946 |
|
MD5 | 1feec55a3d88e5598679fb695b6af982 |
|
BLAKE2b-256 | ca52c39494dba5d0ae60ede8b03b2bd3e67c876a59935dd45795ca745d1e004f |