Example #1
0
def _table_limit(table, n, offset=0):
    """
    Select the first n rows at beginning of table (may not be deterministic
    depending on implementatino and presence of a sorting).

    Parameters
    ----------
    n : int
      Rows to include
    offset : int, default 0
      Number of rows to skip first

    Returns
    -------
    limited : TableExpr
    """
    op = _ops.Limit(table, n, offset=offset)
    return TableExpr(op)
Example #2
0
    def limit(self, n: int, offset: int = 0) -> TableExpr:
        """Select the first `n` rows at beginning of table starting at `offset`.

        Parameters
        ----------
        n
            Number of rows to include
        offset
            Number of rows to skip first

        Returns
        -------
        TableExpr
            The first `n` rows of `table` starting at `offset`
        """
        from .. import operations as ops

        op = ops.Limit(self, n, offset=offset)
        return op.to_expr()