Class: Daru::Accessors::DataFrameByRow

Inherits:
Object
  • Object
show all
Defined in:
lib/daru/accessors/dataframe_by_row.rb

Instance Method Summary collapse

Constructor Details

#initialize(data_frame) ⇒ DataFrameByRow

Returns a new instance of DataFrameByRow.



4
5
6
# File 'lib/daru/accessors/dataframe_by_row.rb', line 4

def initialize data_frame
  @data_frame = data_frame
end

Instance Method Details

#[](*names) ⇒ Object



8
9
10
# File 'lib/daru/accessors/dataframe_by_row.rb', line 8

def [](*names)
  @data_frame[*names, :row]
end

#[]=(*names, vector) ⇒ Object



12
13
14
# File 'lib/daru/accessors/dataframe_by_row.rb', line 12

def []=(*names, vector)
  @data_frame[*names, :row] = vector
end

#at(*positions) ⇒ Object



16
17
18
# File 'lib/daru/accessors/dataframe_by_row.rb', line 16

def at *positions
  @data_frame.row_at(*positions)
end

#set_at(positions, vector) ⇒ Object



20
21
22
# File 'lib/daru/accessors/dataframe_by_row.rb', line 20

def set_at positions, vector
  @data_frame.set_row_at(positions, vector)
end