Skip to content

_bucket_values_pandas

Internal helper
This page documents an internal implementation helper, not a primary public API.
Source code in src/fabricops_kit/technical_columns.py
102
103
104
def _bucket_values_pandas(series: pd.Series, bucket_size: int) -> tuple[pd.Series, pd.Series]:
    hashes = series.apply(lambda v: int(hashlib.sha256(_safe_string(v).encode("utf-8")).hexdigest(), 16))
    return hashes % bucket_size, hashes % 1_000_000