Method: Rust::DataFrame#row

Defined in:
lib/rust/core/types/dataframe.rb

#row(i) ⇒ Object

Returns the i-th row of the data-frame



51
52
53
54
55
56
57
# File 'lib/rust/core/types/dataframe.rb', line 51

def row(i)
    if i < 0 || i >= self.rows
        return nil
    else
        return @data.map { |label, values| [label, values[i]] }.to_h
    end
end