hash()

audformat.utils.hash(obj)[source]

Create hash from object.

Objects with the same elements produce the same hash string independent of the ordering of the elements.

Parameters

obj (Union[Index, Series, DataFrame]) – object

Return type

str

Returns

hash string

Examples

>>> index = filewise_index(["f1", "f2"])
>>> hash(index)
'-4231615416436839963'
>>> y = pd.Series(0, index)
>>> hash(y)
'5251663970176285425'