def head(self, n: int=5) -> 'DataFrame':
    "\n        Return the first `n` rows.\n\n        This function returns the first `n` rows for the object based\n        on position. It is useful for quickly testing if your object\n        has the right type of data in it.\n\n        Parameters\n        ----------\n        n : int, default 5\n            Number of rows to select.\n\n        Returns\n        -------\n        obj_head : same type as caller\n            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 first 5 lines\n\n        >>> df.head()\n              animal\n        0  alligator\n        1        bee\n        2     falcon\n        3       lion\n        4     monkey\n\n        Viewing the first `n` lines (three in this case)\n\n        >>> df.head(3)\n              animal\n        0  alligator\n        1        bee\n        2     falcon\n        "
    if (n < 0):
        n = (len(self) + n)
    if (n <= 0):
        return DataFrame(self._internal.with_filter(SF.lit(False)))
    else:
        sdf = self._internal.resolved_copy.spark_frame
        if get_option('compute.ordered_head'):
            sdf = sdf.orderBy(NATURAL_ORDER_COLUMN_NAME)
        return DataFrame(self._internal.with_new_sdf(sdf.limit(n)))
Return the first `n` rows.

This function returns the first `n` rows for the object based
on position. It is useful for quickly testing if your object
has the right type of data in it.

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

Returns
-------
obj_head : same type as caller
    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 first 5 lines

>>> df.head()
      animal
0  alligator
1        bee
2     falcon
3       lion
4     monkey

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

>>> df.head(3)
      animal
0  alligator
1        bee
2     falcon
def head(self, n: int=5) -> 'DataFrame':
    "\n        Return the first `n` rows.\n\n        This function returns the first `n` rows for the object based\n        on position. It is useful for quickly testing if your object\n        has the right type of data in it.\n\n        Parameters\n        ----------\n        n : int, default 5\n            Number of rows to select.\n\n        Returns\n        -------\n        obj_head : same type as caller\n            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 first 5 lines\n\n        >>> df.head()\n              animal\n        0  alligator\n        1        bee\n        2     falcon\n        3       lion\n        4     monkey\n\n        Viewing the first `n` lines (three in this case)\n\n        >>> df.head(3)\n              animal\n        0  alligator\n        1        bee\n        2     falcon\n        "
    if (n < 0):
        n = (len(self) + n)
    if (n <= 0):
        return DataFrame(self._internal.with_filter(SF.lit(False)))
    else:
        sdf = self._internal.resolved_copy.spark_frame
        if get_option('compute.ordered_head'):
            sdf = sdf.orderBy(NATURAL_ORDER_COLUMN_NAME)
        return DataFrame(self._internal.with_new_sdf(sdf.limit(n)))