Class: Arrow::Column
Instance Attribute Summary collapse
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #[](i) ⇒ Object
- #cast(target_data_type, options: nil) ⇒ Object
- #count(options: nil) ⇒ Object
- #data_type ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(container, index) ⇒ Column
constructor
A new instance of Column.
- #max(options: nil) ⇒ Object
- #min(options: nil) ⇒ Object
- #n_nulls ⇒ Object
- #n_rows ⇒ Object (also: #size, #length)
- #name ⇒ Object
- #null?(i) ⇒ Boolean
- #reverse_each(&block) ⇒ Object
- #sum(options: nil) ⇒ Object
- #uniq ⇒ Object
- #unique ⇒ Object
- #valid?(i) ⇒ Boolean
Constructor Details
#initialize(container, index) ⇒ Column
Returns a new instance of Column.
25 26 27 28 29 30 31 |
# File 'lib/arrow/column.rb', line 25 def initialize(container, index) @container = container @index = index @field = @container.schema[@index] @data = @container.get_column_data(@index) @container.share_input(@data) end |
Instance Attribute Details
#container ⇒ Object (readonly)
Returns the value of attribute container.
22 23 24 |
# File 'lib/arrow/column.rb', line 22 def container @container end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
24 25 26 |
# File 'lib/arrow/column.rb', line 24 def data @data end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
23 24 25 |
# File 'lib/arrow/column.rb', line 23 def field @field end |
Instance Method Details
#==(other) ⇒ Object
71 72 73 74 75 |
# File 'lib/arrow/column.rb', line 71 def ==(other) other.is_a?(self.class) and @field == other.field and @data == other.data end |
#[](i) ⇒ Object
49 50 51 |
# File 'lib/arrow/column.rb', line 49 def [](i) @data[i] end |
#cast(target_data_type, options: nil) ⇒ Object
101 102 103 |
# File 'lib/arrow/column.rb', line 101 def cast(target_data_type, options: nil) @data.cast(target_data_type, options: ) end |
#count(options: nil) ⇒ Object
77 78 79 |
# File 'lib/arrow/column.rb', line 77 def count(options: nil) @data.count(options: ) end |
#data_type ⇒ Object
37 38 39 |
# File 'lib/arrow/column.rb', line 37 def data_type @field.data_type end |
#each(&block) ⇒ Object
53 54 55 |
# File 'lib/arrow/column.rb', line 53 def each(&block) @data.each(&block) end |
#max(options: nil) ⇒ Object
89 90 91 |
# File 'lib/arrow/column.rb', line 89 def max(options: nil) @data.max(options: ) end |
#min(options: nil) ⇒ Object
85 86 87 |
# File 'lib/arrow/column.rb', line 85 def min(options: nil) @data.min(options: ) end |
#n_nulls ⇒ Object
67 68 69 |
# File 'lib/arrow/column.rb', line 67 def n_nulls @data.n_nulls end |
#n_rows ⇒ Object Also known as: size, length
61 62 63 |
# File 'lib/arrow/column.rb', line 61 def n_rows @data.n_rows end |
#name ⇒ Object
33 34 35 |
# File 'lib/arrow/column.rb', line 33 def name @field.name end |
#null?(i) ⇒ Boolean
41 42 43 |
# File 'lib/arrow/column.rb', line 41 def null?(i) @data.null?(i) end |
#reverse_each(&block) ⇒ Object
57 58 59 |
# File 'lib/arrow/column.rb', line 57 def reverse_each(&block) @data.reverse_each(&block) end |
#sum(options: nil) ⇒ Object
81 82 83 |
# File 'lib/arrow/column.rb', line 81 def sum(options: nil) @data.sum(options: ) end |
#uniq ⇒ Object
97 98 99 |
# File 'lib/arrow/column.rb', line 97 def uniq @data.uniq end |
#unique ⇒ Object
93 94 95 |
# File 'lib/arrow/column.rb', line 93 def unique @data.unique end |
#valid?(i) ⇒ Boolean
45 46 47 |
# File 'lib/arrow/column.rb', line 45 def valid?(i) @data.valid?(i) end |