Class: Rover::DataFrame
- Inherits:
-
Object
- Object
- Rover::DataFrame
- Defined in:
- lib/to_csv.rb
Instance Method Summary collapse
- #outer_join ⇒ Object
- #simple_pivot(index, vectors) ⇒ Object
- #to_daru ⇒ Object
-
#write_csv(path, encoding: nil) ⇒ Object
Rover#to_csv is already exist.
Instance Method Details
#outer_join ⇒ Object
114 115 116 117 118 |
# File 'lib/to_csv.rb', line 114 def outer_join ddr = self.to_daru # j = ddr.join ## 外部結合 return j.to_rover end |
#simple_pivot(index, vectors) ⇒ Object
108 109 110 111 112 |
# File 'lib/to_csv.rb', line 108 def simple_pivot(index, vectors, ...) ddr = self.to_daru piv = ddr.simple_pivot(index, vectors, ...) return piv.to_rover end |
#to_daru ⇒ Object
104 105 106 |
# File 'lib/to_csv.rb', line 104 def to_daru Daru::DataFrame.new(self.to_a) end |
#write_csv(path, encoding: nil) ⇒ Object
Rover#to_csv is already exist.
99 100 101 102 |
# File 'lib/to_csv.rb', line 99 def write_csv(path, encoding: nil) enc = encoding.nil? ? "" : ":#{encoding}" open(path, "w#{enc}") {|f| f.write self.to_csv} end |