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, **named_aggs) ⇒ LazyFrame
Compute aggregations for each group of a group by operation.
-
#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, **named_aggs) ⇒ LazyFrame
Compute aggregations for each group of a group by operation.
109 110 111 112 |
# File 'lib/polars/lazy_group_by.rb', line 109 def agg(*aggs, **named_aggs) rbexprs = Utils.parse_into_list_of_expressions(*aggs, **named_aggs) Utils.wrap_ldf(@lgb.agg(rbexprs)) end |
#head(n = 5) ⇒ LazyFrame
Get the first n
rows of each group.
142 143 144 |
# File 'lib/polars/lazy_group_by.rb', line 142 def head(n = 5) Utils.wrap_ldf(@lgb.head(n)) end |
#tail(n = 5) ⇒ LazyFrame
Get the last n
rows of each group.
174 175 176 |
# File 'lib/polars/lazy_group_by.rb', line 174 def tail(n = 5) Utils.wrap_ldf(@lgb.tail(n)) end |