def _table_count(self): """ Returns the computed number of rows in the table expression Returns ------- count : Int64Scalar """ return _ops.Count(self, None).to_expr().name('count')
def count(self) -> ir.IntegerScalar: """Compute the number of rows in the table. Returns ------- IntegerScalar Number of rows in the table """ from .. import operations as ops return ops.Count(self, None).to_expr().name("count")
def count(self, where: ir.BooleanValue | None = None) -> ir.IntegerScalar: """Compute the number of rows in an expression. Parameters ---------- where Filter expression Returns ------- IntegerScalar Number of elements in an expression """ import ibis.expr.operations as ops return ops.Count(self, where).to_expr().name("count")
def count(expr, where=None): """ Compute cardinality / sequence size of expression. For array expressions, the count is excluding nulls. For tables, it's the size of the entire table. Returns ------- counts : int64 type """ op = expr.op() if isinstance(op, _ops.DistinctArray): if where is not None: raise NotImplementedError result = op.count().to_expr() else: result = _ops.Count(expr, where).to_expr() return result.name('count')