Class: Remi::DataFrame::Daru

Inherits:
SimpleDelegator
  • Object
show all
Includes:
Remi::DataFrame
Defined in:
lib/remi/data_frame/daru.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Remi::DataFrame

#[], create, daru, #size, #write_csv

Constructor Details

#initialize(*args, **kargs, &block) ⇒ Daru

Returns a new instance of Daru.



6
7
8
9
10
11
12
# File 'lib/remi/data_frame/daru.rb', line 6

def initialize(*args, **kargs, &block)
  if args[0].is_a? ::Daru::DataFrame
    super(args[0])
  else
    super(::Daru::DataFrame.new(*args, **kargs, &block))
  end
end

Class Method Details

.from_hash_dump(filename) ⇒ Object

Public: Creates a DataFrame by reading the dumped version from a file.



26
27
28
# File 'lib/remi/data_frame/daru.rb', line 26

def self.from_hash_dump(filename)
  Marshal.load(File.binread(filename))
end

Instance Method Details

#df_typeObject

Public: Returns the type of DataFrame



16
17
18
# File 'lib/remi/data_frame/daru.rb', line 16

def df_type
  :daru
end

#hash_dump(filename) ⇒ Object

Public: Saves a Dataframe to a file.



21
22
23
# File 'lib/remi/data_frame/daru.rb', line 21

def hash_dump(filename)
  File.binwrite(filename, Marshal.dump(self))
end