def tail(self, n: int=5) -> 'DataFrame':
    "\n        Return the last `n` rows.\n\n        This function returns last `n` rows from the object based on\n        position. It is useful for quickly verifying data, for example,\n        after sorting or appending rows.\n\n        For negative values of `n`, this function returns all rows except\n        the first `n` rows, equivalent to ``df[n:]``.\n\n        Parameters\n        ----------\n        n : int, default 5\n            Number of rows to select.\n\n        Returns\n        -------\n        type of caller\n            The last `n` rows of the caller object.\n\n        See Also\n        --------\n        DataFrame.head : The first `n` rows of the caller object.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',\n        ...                    'monkey', 'parrot', 'shark', 'whale', 'zebra']})\n        >>> df\n              animal\n        0  alligator\n        1        bee\n        2     falcon\n        3       lion\n        4     monkey\n        5     parrot\n        6      shark\n        7      whale\n        8      zebra\n\n        Viewing the last 5 lines\n\n        >>> df.tail()  # doctest: +SKIP\n           animal\n        4  monkey\n        5  parrot\n        6   shark\n        7   whale\n        8   zebra\n\n        Viewing the last `n` lines (three in this case)\n\n        >>> df.tail(3)  # doctest: +SKIP\n          animal\n        6  shark\n        7  whale\n        8  zebra\n\n        For negative values of `n`\n\n        >>> df.tail(-3)  # doctest: +SKIP\n           animal\n        3    lion\n        4  monkey\n        5  parrot\n        6   shark\n        7   whale\n        8   zebra\n        "
    if (not isinstance(n, int)):
        raise TypeError("bad operand type for unary -: '{}'".format(type(n).__name__))
    if (n < 0):
        n = (len(self) + n)
    if (n <= 0):
        return ps.DataFrame(self._internal.with_filter(SF.lit(False)))
    sdf = self._internal.resolved_copy.spark_frame
    rows = sdf.tail(n)
    new_sdf = default_session().createDataFrame(rows, sdf.schema)
    return DataFrame(self._internal.with_new_sdf(new_sdf))
Return the last `n` rows.

This function returns last `n` rows from the object based on
position. It is useful for quickly verifying data, for example,
after sorting or appending rows.

For negative values of `n`, this function returns all rows except
the first `n` rows, equivalent to ``df[n:]``.

Parameters
----------
n : int, default 5
    Number of rows to select.

Returns
-------
type of caller
    The last `n` rows of the caller object.

See Also
--------
DataFrame.head : The first `n` rows of the caller object.

Examples
--------
>>> df = ps.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',
...                    'monkey', 'parrot', 'shark', 'whale', 'zebra']})
>>> df
      animal
0  alligator
1        bee
2     falcon
3       lion
4     monkey
5     parrot
6      shark
7      whale
8      zebra

Viewing the last 5 lines

>>> df.tail()  # doctest: +SKIP
   animal
4  monkey
5  parrot
6   shark
7   whale
8   zebra

Viewing the last `n` lines (three in this case)

>>> df.tail(3)  # doctest: +SKIP
  animal
6  shark
7  whale
8  zebra

For negative values of `n`

>>> df.tail(-3)  # doctest: +SKIP
   animal
3    lion
4  monkey
5  parrot
6   shark
7   whale
8   zebra
def tail(self, n: int=5) -> 'DataFrame':
    "\n        Return the last `n` rows.\n\n        This function returns last `n` rows from the object based on\n        position. It is useful for quickly verifying data, for example,\n        after sorting or appending rows.\n\n        For negative values of `n`, this function returns all rows except\n        the first `n` rows, equivalent to ``df[n:]``.\n\n        Parameters\n        ----------\n        n : int, default 5\n            Number of rows to select.\n\n        Returns\n        -------\n        type of caller\n            The last `n` rows of the caller object.\n\n        See Also\n        --------\n        DataFrame.head : The first `n` rows of the caller object.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'animal': ['alligator', 'bee', 'falcon', 'lion',\n        ...                    'monkey', 'parrot', 'shark', 'whale', 'zebra']})\n        >>> df\n              animal\n        0  alligator\n        1        bee\n        2     falcon\n        3       lion\n        4     monkey\n        5     parrot\n        6      shark\n        7      whale\n        8      zebra\n\n        Viewing the last 5 lines\n\n        >>> df.tail()  # doctest: +SKIP\n           animal\n        4  monkey\n        5  parrot\n        6   shark\n        7   whale\n        8   zebra\n\n        Viewing the last `n` lines (three in this case)\n\n        >>> df.tail(3)  # doctest: +SKIP\n          animal\n        6  shark\n        7  whale\n        8  zebra\n\n        For negative values of `n`\n\n        >>> df.tail(-3)  # doctest: +SKIP\n           animal\n        3    lion\n        4  monkey\n        5  parrot\n        6   shark\n        7   whale\n        8   zebra\n        "
    if (not isinstance(n, int)):
        raise TypeError("bad operand type for unary -: '{}'".format(type(n).__name__))
    if (n < 0):
        n = (len(self) + n)
    if (n <= 0):
        return ps.DataFrame(self._internal.with_filter(SF.lit(False)))
    sdf = self._internal.resolved_copy.spark_frame
    rows = sdf.tail(n)
    new_sdf = default_session().createDataFrame(rows, sdf.schema)
    return DataFrame(self._internal.with_new_sdf(new_sdf))