def is_nested_object ( obj ) : if isinstance ( obj , ABCSeries ) and is_object_dtype ( obj ) : if any ( isinstance ( v , ABCSeries ) for v in obj . values ) : return True return False
check if an object is nested arbitrarily deep within a tuple python
return a boolean if we have a nested object e . g . a Series with 1 or more Series elements
def is_nested_object(obj):
    """
    return a boolean if we have a nested object, e.g. a Series with 1 or
    more Series elements

    This may not be necessarily be performant.

    """

    if isinstance(obj, ABCSeries) and is_object_dtype(obj):

        if any(isinstance(v, ABCSeries) for v in obj.values):
            return True

    return False