Module: Arrow::ArrayComputable

Included in:
Array, ChunkedArray
Defined in:
lib/arrow/array-computable.rb

Instance Method Summary collapse

Instance Method Details

#index(value) ⇒ Integer

Finds the index of the first occurrence of a given value.

Parameters:

  • value (Object)

    The value to be compared.

Returns:

  • (Integer)

    The index of the first occurrence of a given value on found, -1 on not found.

Since:

  • 12.0.0



40
41
42
43
# File 'lib/arrow/array-computable.rb', line 40

def index(value)
  value = Scalar.resolve(value, value_data_type)
  compute("index", options: {value: value}).value
end

#max(options: nil) ⇒ Object



24
25
26
# File 'lib/arrow/array-computable.rb', line 24

def max(options: nil)
  compute("max", options: options).value
end

#min(options: nil) ⇒ Object



20
21
22
# File 'lib/arrow/array-computable.rb', line 20

def min(options: nil)
  compute("min", options: options).value
end

#uniqObject



28
29
30
# File 'lib/arrow/array-computable.rb', line 28

def uniq
  unique.values
end