hash()¶
- audformat.utils.hash(obj, strict=False)[source]¶
Create hash from object.
If
strict
isFalse
, objects with the same elements produce the same hash string independent of the ordering of the elements, and level or column names.Warning
If
obj
is a dataframe or series with data type"Int64"
, andstrict
isFalse
, the returned hash value changes withpandas>=2.2.0
.- Parameters
- Return type
- Returns
hash string with 19 characters, or 32 characters if
strict
isTrue
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) '0741235e2250e0fcd9ab7b64972f5047' >>> hash(index[::-1], strict=True) # reversed index 'c6639d377897dd9353dc3e8b2968170d'