pandas.api.types.is_named_tuple

pandas.api.types.is_named_tuple(obj) → bool[source]

Check if the object is a named tuple.

Parameters
objThe object to check
Returns
is_named_tuplebool

Whether obj is a named tuple.

Examples

>>> Point = namedtuple("Point", ["x", "y"])
>>> p = Point(1, 2)
>>>
>>> is_named_tuple(p)
True
>>> is_named_tuple((1, 2))
False