mikon 0.1.0 → 0.1.2.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -0
- data/example/Mikon_Manipuration.ipynb +182 -7
- data/example/data/gdp.csv +4129 -0
- data/ext/mikon/extconf.rb +3 -0
- data/lib/mikon/core/array.rb +8 -0
- data/lib/mikon/core/dataframe.rb +11 -1
- data/lib/mikon/core/series.rb +5 -1
- data/lib/mikon/plot.rb +1 -1
- data/lib/mikon/version.rb +1 -1
- data/mikon.gemspec +1 -1
- metadata +8 -19
data/lib/mikon/core/array.rb
CHANGED
@@ -40,6 +40,10 @@ module Mikon
|
|
40
40
|
@dtype = @data.dtype
|
41
41
|
end
|
42
42
|
|
43
|
+
def dup
|
44
|
+
Mikon::DArray.new(@data.dup)
|
45
|
+
end
|
46
|
+
|
43
47
|
def each(&block)
|
44
48
|
@data.each(&block)
|
45
49
|
end
|
@@ -104,6 +108,10 @@ module Mikon
|
|
104
108
|
end
|
105
109
|
end
|
106
110
|
|
111
|
+
def to_json
|
112
|
+
@data.to_json
|
113
|
+
end
|
114
|
+
|
107
115
|
def to_a
|
108
116
|
@data.to_a
|
109
117
|
end
|
data/lib/mikon/core/dataframe.rb
CHANGED
@@ -19,8 +19,10 @@ module Mikon
|
|
19
19
|
case
|
20
20
|
when source.is_a?(Array)
|
21
21
|
case
|
22
|
+
when source.length == 0
|
23
|
+
@data = [DArray.new([])]
|
22
24
|
when source.all? {|el| el.is_a?(Mikon::Series)}
|
23
|
-
raise "NotImplementedError"
|
25
|
+
raise "NotImplementedError" + source.to_s
|
24
26
|
|
25
27
|
when source.all? {|el| el.is_a?(Mikon::DArray)}
|
26
28
|
@data = source
|
@@ -353,6 +355,14 @@ module Mikon
|
|
353
355
|
@data.delete_at(pos)
|
354
356
|
end
|
355
357
|
|
358
|
+
def dup
|
359
|
+
Mikon::DataFrame.new(@data.map{|darr| darr.dup}, {index: @index, label: @labels})
|
360
|
+
end
|
361
|
+
|
362
|
+
def dup_only_valid
|
363
|
+
self.dup
|
364
|
+
end
|
365
|
+
|
356
366
|
attr_reader :name, :index, :labels
|
357
367
|
end
|
358
368
|
|
data/lib/mikon/core/series.rb
CHANGED
@@ -4,7 +4,7 @@ module Mikon
|
|
4
4
|
class Series
|
5
5
|
include Enumerable
|
6
6
|
extend Forwardable
|
7
|
-
def_delegators :@data, :max, :min
|
7
|
+
def_delegators :@data, :max, :min, :uniq
|
8
8
|
def_delegators :@data, *(Mikon::Stats.instance_methods)
|
9
9
|
attr_reader :index, :name
|
10
10
|
|
@@ -67,6 +67,10 @@ module Mikon
|
|
67
67
|
Formatador.display_table(arr.select{|el| !(el.nil?)})
|
68
68
|
end
|
69
69
|
|
70
|
+
def to_json(*args)
|
71
|
+
@data.to_json
|
72
|
+
end
|
73
|
+
|
70
74
|
def name(new_name=nil)
|
71
75
|
if new_name.nil?
|
72
76
|
@name
|
data/lib/mikon/plot.rb
CHANGED
data/lib/mikon/version.rb
CHANGED
data/mikon.gemspec
CHANGED
@@ -17,10 +17,10 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
|
+
spec.extensions = Dir["ext/**/extconf.rb"]
|
20
21
|
|
21
22
|
spec.add_runtime_dependency "nmatrix", "~> 0.1.0.rc5"
|
22
23
|
spec.add_runtime_dependency "formatador", "~> 0.2.5"
|
23
|
-
spec.add_runtime_dependency "nyaplot", "~> 0.1.1"
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.5"
|
25
25
|
spec.add_development_dependency "rake"
|
26
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mikon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naoki Nishida
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nmatrix
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.2.5
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: nyaplot
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.1.1
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.1.1
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: bundler
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,7 +70,8 @@ description: DataFrame works with NMatrix, Statsample, and Nyaplot
|
|
84
70
|
email:
|
85
71
|
- domitry@gmail.com
|
86
72
|
executables: []
|
87
|
-
extensions:
|
73
|
+
extensions:
|
74
|
+
- ext/mikon/extconf.rb
|
88
75
|
extra_rdoc_files: []
|
89
76
|
files:
|
90
77
|
- ".gitignore"
|
@@ -95,6 +82,8 @@ files:
|
|
95
82
|
- example/Mikon_Manipuration.ipynb
|
96
83
|
- example/Mikon_stats.ipynb
|
97
84
|
- example/Plotting.ipynb
|
85
|
+
- example/data/gdp.csv
|
86
|
+
- ext/mikon/extconf.rb
|
98
87
|
- lib/mikon.rb
|
99
88
|
- lib/mikon/core/array.rb
|
100
89
|
- lib/mikon/core/dataframe.rb
|
@@ -127,9 +116,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
116
|
version: '0'
|
128
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
118
|
requirements:
|
130
|
-
- - "
|
119
|
+
- - ">"
|
131
120
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
121
|
+
version: 1.3.1
|
133
122
|
requirements: []
|
134
123
|
rubyforge_project:
|
135
124
|
rubygems_version: 2.2.2
|