hash()¶
- audformat.utils.hash(obj, strict=False)[source]¶
Create hash from object.
If
strictisFalse, objects with the same elements produce the same hash string independent of the ordering of the elements, and level or column names.Warning
If
objis a dataframe or series with data type"Int64", andstrictisFalse, the returned hash value changes withpandas>=2.2.0.Warning
The returned hash with
strictisTruehas changed inaudformat>=1.4.0.- Parameters:
- Return type:
- Returns:
hash string with 19 characters, or 32 characters if
strictisTrue
Examples
>>> index = filewise_index(["f1", "f2"]) >>> hash(index) '-4231615416436839963' >>> hash(index[::-1]) # reversed index '-4231615416436839963' >>> y = pd.Series(0, index) >>> hash(y) '5251663970176285425' >>> hash(index, strict=True) 'fb9a35ca0492404e5f9dba30eebb3bfb' >>> hash(index[::-1], strict=True) # reversed index 'b59b53388eb3ecf5a04ddd0edb89152a'