Class: Polars::LazyGroupBy
- Inherits:
-
Object
- Object
- Polars::LazyGroupBy
- Defined in:
- lib/polars/lazy_group_by.rb
Overview
Created by df.lazy.group_by("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.
12 13 14 15 |
# File 'lib/polars/lazy_group_by.rb', line 12 def agg(aggs) rbexprs = Utils.selection_to_rbexpr_list(aggs) Utils.wrap_ldf(@lgb.agg(rbexprs)) end |
#head(n = 5) ⇒ LazyFrame
Get the first n
rows of each group.
45 46 47 |
# File 'lib/polars/lazy_group_by.rb', line 45 def head(n = 5) Utils.wrap_ldf(@lgb.head(n)) end |
#tail(n = 5) ⇒ LazyFrame
Get the last n
rows of each group.
77 78 79 |
# File 'lib/polars/lazy_group_by.rb', line 77 def tail(n = 5) Utils.wrap_ldf(@lgb.tail(n)) end |