W3cubDocs

/pandas 0.25

pandas.util.hash_array

pandas.util.hash_array(vals, encoding='utf8', hash_key=None, categorize=True) [source]

Given a 1d array, return an array of deterministic integers.

New in version 0.19.2.

Parameters:
vals : ndarray, Categorical
encoding : string, default ‘utf8’

encoding for data & key when strings

hash_key : string key to encode, default to _default_hash_key
categorize : bool, default True

Whether to first categorize object arrays before hashing. This is more efficient when the array contains duplicate values.

New in version 0.20.0.

Returns:
1d uint64 numpy array of hash values, same length as the vals

© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.util.hash_array.html