Class: Polars::ArrayNameSpace
- Inherits:
-
Object
- Object
- Polars::ArrayNameSpace
- Defined in:
- lib/polars/array_name_space.rb
Overview
Series.arr namespace.
Instance Method Summary collapse
-
#all ⇒ Series
Evaluate whether all boolean values are true for every subarray.
-
#any ⇒ Series
Evaluate whether any boolean value is true for every subarray.
-
#arg_max ⇒ Series
Retrieve the index of the maximum value in every sub-array.
-
#arg_min ⇒ Series
Retrieve the index of the minimal value in every sub-array.
-
#contains(item) ⇒ Series
Check if sub-arrays contain the given item.
-
#count_matches(element) ⇒ Series
Count how often the value produced by
element
occurs. -
#explode ⇒ Series
Returns a column with a separate row for every array element.
-
#first ⇒ Series
Get the first value of the sub-arrays.
-
#get(index) ⇒ Series
Get the value by index in the sub-arrays.
-
#join(separator, ignore_nulls: true) ⇒ Series
Join all string items in a sub-array and place a separator between them.
-
#last ⇒ Series
Get the last value of the sub-arrays.
-
#max ⇒ Series
Compute the max values of the sub-arrays.
-
#min ⇒ Series
Compute the min values of the sub-arrays.
-
#reverse ⇒ Series
Reverse the arrays in this column.
-
#sort(descending: false, nulls_last: false) ⇒ Series
Sort the arrays in this column.
-
#sum ⇒ Series
Compute the sum values of the sub-arrays.
-
#to_list ⇒ Series
Convert an Array column into a List column with the same inner data type.
-
#unique(maintain_order: false) ⇒ Series
Get the unique/distinct values in the array.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Polars::ExprDispatch
Instance Method Details
#all ⇒ Series
Evaluate whether all boolean values are true for every subarray.
167 168 169 |
# File 'lib/polars/array_name_space.rb', line 167 def all super end |
#any ⇒ Series
Evaluate whether any boolean value is true for every subarray.
143 144 145 |
# File 'lib/polars/array_name_space.rb', line 143 def any super end |
#arg_max ⇒ Series
Retrieve the index of the maximum value in every sub-array.
254 255 256 |
# File 'lib/polars/array_name_space.rb', line 254 def arg_max super end |
#arg_min ⇒ Series
Retrieve the index of the minimal value in every sub-array.
236 237 238 |
# File 'lib/polars/array_name_space.rb', line 236 def arg_min super end |
#contains(item) ⇒ Series
Check if sub-arrays contain the given item.
398 399 400 |
# File 'lib/polars/array_name_space.rb', line 398 def contains(item) super end |
#count_matches(element) ⇒ Series
Count how often the value produced by element
occurs.
419 420 421 |
# File 'lib/polars/array_name_space.rb', line 419 def count_matches(element) super end |
#explode ⇒ Series
Returns a column with a separate row for every array element.
374 375 376 |
# File 'lib/polars/array_name_space.rb', line 374 def explode super end |
#first ⇒ Series
Get the first value of the sub-arrays.
303 304 305 |
# File 'lib/polars/array_name_space.rb', line 303 def first super end |
#get(index) ⇒ Series
Get the value by index in the sub-arrays.
So index 0
would return the first item of every sublist
and index -1
would return the last item of every sublist
if an index is out of bounds, it will return a nil
.
282 283 284 |
# File 'lib/polars/array_name_space.rb', line 282 def get(index) super end |
#join(separator, ignore_nulls: true) ⇒ Series
Join all string items in a sub-array and place a separator between them.
This errors if inner type of array != String
.
352 353 354 |
# File 'lib/polars/array_name_space.rb', line 352 def join(separator, ignore_nulls: true) super end |
#last ⇒ Series
Get the last value of the sub-arrays.
324 325 326 |
# File 'lib/polars/array_name_space.rb', line 324 def last super end |
#max ⇒ Series
Compute the max values of the sub-arrays.
49 50 51 |
# File 'lib/polars/array_name_space.rb', line 49 def max super end |
#min ⇒ Series
Compute the min values of the sub-arrays.
29 30 31 |
# File 'lib/polars/array_name_space.rb', line 29 def min super end |
#reverse ⇒ Series
Reverse the arrays in this column.
218 219 220 |
# File 'lib/polars/array_name_space.rb', line 218 def reverse super end |
#sort(descending: false, nulls_last: false) ⇒ Series
Sort the arrays in this column.
200 201 202 |
# File 'lib/polars/array_name_space.rb', line 200 def sort(descending: false, nulls_last: false) super end |
#sum ⇒ Series
Compute the sum values of the sub-arrays.
73 74 75 |
# File 'lib/polars/array_name_space.rb', line 73 def sum super end |
#to_list ⇒ Series
Convert an Array column into a List column with the same inner data type.
119 120 121 |
# File 'lib/polars/array_name_space.rb', line 119 def to_list super end |
#unique(maintain_order: false) ⇒ Series
Get the unique/distinct values in the array.
101 102 103 |
# File 'lib/polars/array_name_space.rb', line 101 def unique(maintain_order: false) super end |