def bool(self) -> bool:
    "\n        Return the bool of a single element in the current object.\n\n        This must be a boolean scalar value, either True or False. Raise a ValueError if\n        the object does not have exactly 1 element, or that element is not boolean\n\n        Returns\n        --------\n        bool\n\n        Examples\n        --------\n        >>> ps.DataFrame({'a': [True]}).bool()\n        True\n\n        >>> ps.Series([False]).bool()\n        False\n\n        If there are non-boolean or multiple values exist, it raises an exception in all\n        cases as below.\n\n        >>> ps.DataFrame({'a': ['a']}).bool()\n        Traceback (most recent call last):\n          ...\n        ValueError: bool cannot act on a non-boolean single element DataFrame\n\n        >>> ps.DataFrame({'a': [True], 'b': [False]}).bool()  # doctest: +NORMALIZE_WHITESPACE\n        Traceback (most recent call last):\n          ...\n        ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(),\n        a.item(), a.any() or a.all().\n\n        >>> ps.Series([1]).bool()\n        Traceback (most recent call last):\n          ...\n        ValueError: bool cannot act on a non-boolean single element DataFrame\n        "
    if isinstance(self, ps.DataFrame):
        df = self
    elif isinstance(self, ps.Series):
        df = self.to_dataframe()
    else:
        raise TypeError(('bool() expects DataFrame or Series; however, got [%s]' % (self,)))
    return df.head(2)._to_internal_pandas().bool()
Return the bool of a single element in the current object.

This must be a boolean scalar value, either True or False. Raise a ValueError if
the object does not have exactly 1 element, or that element is not boolean

Returns
--------
bool

Examples
--------
>>> ps.DataFrame({'a': [True]}).bool()
True

>>> ps.Series([False]).bool()
False

If there are non-boolean or multiple values exist, it raises an exception in all
cases as below.

>>> ps.DataFrame({'a': ['a']}).bool()
Traceback (most recent call last):
  ...
ValueError: bool cannot act on a non-boolean single element DataFrame

>>> ps.DataFrame({'a': [True], 'b': [False]}).bool()  # doctest: +NORMALIZE_WHITESPACE
Traceback (most recent call last):
  ...
ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(),
a.item(), a.any() or a.all().

>>> ps.Series([1]).bool()
Traceback (most recent call last):
  ...
ValueError: bool cannot act on a non-boolean single element DataFrame
def bool(self) -> bool:
    "\n        Return the bool of a single element in the current object.\n\n        This must be a boolean scalar value, either True or False. Raise a ValueError if\n        the object does not have exactly 1 element, or that element is not boolean\n\n        Returns\n        --------\n        bool\n\n        Examples\n        --------\n        >>> ps.DataFrame({'a': [True]}).bool()\n        True\n\n        >>> ps.Series([False]).bool()\n        False\n\n        If there are non-boolean or multiple values exist, it raises an exception in all\n        cases as below.\n\n        >>> ps.DataFrame({'a': ['a']}).bool()\n        Traceback (most recent call last):\n          ...\n        ValueError: bool cannot act on a non-boolean single element DataFrame\n\n        >>> ps.DataFrame({'a': [True], 'b': [False]}).bool()  # doctest: +NORMALIZE_WHITESPACE\n        Traceback (most recent call last):\n          ...\n        ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(),\n        a.item(), a.any() or a.all().\n\n        >>> ps.Series([1]).bool()\n        Traceback (most recent call last):\n          ...\n        ValueError: bool cannot act on a non-boolean single element DataFrame\n        "
    if isinstance(self, ps.DataFrame):
        df = self
    elif isinstance(self, ps.Series):
        df = self.to_dataframe()
    else:
        raise TypeError(('bool() expects DataFrame or Series; however, got [%s]' % (self,)))
    return df.head(2)._to_internal_pandas().bool()