Class: Polars::LazyGroupBy
- Inherits:
-
Object
- Object
- Polars::LazyGroupBy
- Defined in:
- lib/polars/lazy_group_by.rb
Overview
Created by df.lazy.groupby("foo")
.
Instance Method Summary collapse
-
#agg(aggs) ⇒ LazyFrame
Describe the aggregation that need to be done on a group.
-
#head(n = 5) ⇒ LazyFrame
Get the first
n
rows of each group. -
#tail(n = 5) ⇒ LazyFrame
Get the last
n
rows of each group.
Instance Method Details
#agg(aggs) ⇒ LazyFrame
Describe the aggregation that need to be done on a group.
13 14 15 16 |
# File 'lib/polars/lazy_group_by.rb', line 13 def agg(aggs) rbexprs = Utils.selection_to_rbexpr_list(aggs) @lazyframe_class._from_rbldf(@lgb.agg(rbexprs)) end |
#head(n = 5) ⇒ LazyFrame
Get the first n
rows of each group.
50 51 52 |
# File 'lib/polars/lazy_group_by.rb', line 50 def head(n = 5) @lazyframe_class._from_rbldf(@lgb.head(n)) end |
#tail(n = 5) ⇒ LazyFrame
Get the last n
rows of each group.
86 87 88 |
# File 'lib/polars/lazy_group_by.rb', line 86 def tail(n = 5) @lazyframe_class._from_rbldf(@lgb.tail(n)) end |