Table Of Contents

Search

Enter search terms or a module, class or function name.

pandas.api.types.is_hashable

pandas.api.types.is_hashable(obj)[source]

Return True if hash(obj) will succeed, False otherwise.

Some types will pass a test against collections.Hashable but fail when they are actually hashed with hash().

Distinguish between these and other types by trying the call to hash() and seeing if they raise TypeError.

Examples

>>> a = ([],)
>>> isinstance(a, collections.Hashable)
True
>>> is_hashable(a)
False
Scroll To Top