featurebyte.AggFunc¶
class AggFunc( )
Description¶
The AggFunc enum class provides a way to represent various aggregation methods in your code. It helps reduce errors by defining a set of supported aggregation methods. Each enum constant corresponds to a specific aggregation method.
Possible Values¶
- SUM
Compute sum of values. - AVG
Compute average value. - MIN
Compute minimum value. - MAX
Compute maximum value. - COUNT
Compute row count. - NA_COUNT
Compute count of missing values. - STD
Compute standard deviation of values. - LATEST
Compute the latest value.
Examples¶
>>> items_view = catalog.get_view("INVOICEITEMS")
>>> # Group items by the column GroceryInvoiceGuid that references the customer entity
>>> items_by_invoice = items_view.groupby("GroceryInvoiceGuid")
>>> # Get the number of items in each invoice
>>> invoice_item_count = items_by_invoice.aggregate(
... None,
... method=fb.AggFunc.COUNT,
... feature_name="InvoiceItemCount",
... )