Method: Polars::Expr#gather
- Defined in:
- lib/polars/expr.rb
permalink #gather(indices) ⇒ Expr Also known as: take
Take values by index.
1630 1631 1632 1633 1634 1635 1636 1637 |
# File 'lib/polars/expr.rb', line 1630 def gather(indices) if indices.is_a?(::Array) indices_lit = Polars.lit(Series.new("", indices, dtype: :u32))._rbexpr else indices_lit = Utils.parse_into_expression(indices, str_as_lit: false) end _from_rbexpr(_rbexpr.gather(indices_lit)) end |