Given a 1d array, return an array of deterministic integers.
Encoding for data & key when strings.
Hash_key for string key to encode.
Whether to first categorize object arrays before hashing. This is more efficient when the array contains duplicate values.
Hashed values, same length as the vals.
Examples
>>> pd.util.hash_array(np.array([1, 2, 3]))
array([ 6238072747940578789, 15839785061582574730, 2185194620014831856],
dtype=uint64)
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.util.hash_array.html