red_amber 0.4.2 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.devcontainer/Dockerfile +75 -0
  3. data/.devcontainer/devcontainer.json +38 -0
  4. data/.devcontainer/onCreateCommand.sh +22 -0
  5. data/.rubocop.yml +11 -5
  6. data/CHANGELOG.md +141 -17
  7. data/Gemfile +5 -6
  8. data/README.ja.md +271 -0
  9. data/README.md +52 -31
  10. data/Rakefile +55 -0
  11. data/benchmark/group.yml +12 -5
  12. data/doc/Dev_Containers.ja.md +290 -0
  13. data/doc/Dev_Containers.md +292 -0
  14. data/doc/qmd/examples_of_red_amber.qmd +4596 -0
  15. data/doc/qmd/red-amber.qmd +90 -0
  16. data/docker/Dockerfile +2 -2
  17. data/docker/Gemfile +8 -3
  18. data/docker/docker-compose.yml +1 -1
  19. data/docker/readme.md +5 -5
  20. data/lib/red_amber/data_frame.rb +78 -4
  21. data/lib/red_amber/data_frame_combinable.rb +147 -119
  22. data/lib/red_amber/data_frame_displayable.rb +7 -6
  23. data/lib/red_amber/data_frame_loadsave.rb +1 -1
  24. data/lib/red_amber/data_frame_selectable.rb +51 -2
  25. data/lib/red_amber/data_frame_variable_operation.rb +6 -6
  26. data/lib/red_amber/group.rb +476 -127
  27. data/lib/red_amber/helper.rb +26 -0
  28. data/lib/red_amber/subframes.rb +18 -11
  29. data/lib/red_amber/vector.rb +45 -25
  30. data/lib/red_amber/vector_aggregation.rb +26 -0
  31. data/lib/red_amber/vector_selectable.rb +124 -40
  32. data/lib/red_amber/vector_string_function.rb +279 -0
  33. data/lib/red_amber/vector_unary_element_wise.rb +4 -0
  34. data/lib/red_amber/vector_updatable.rb +28 -0
  35. data/lib/red_amber/version.rb +1 -1
  36. data/lib/red_amber.rb +2 -1
  37. data/red_amber.gemspec +3 -3
  38. metadata +19 -14
  39. data/docker/Gemfile.lock +0 -80
  40. data/docker/example +0 -74
  41. data/docker/notebook/examples_of_red_amber.ipynb +0 -8562
  42. data/docker/notebook/red-amber.ipynb +0 -188
@@ -0,0 +1,279 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RedAmber
4
+ # Mix-in for class Vector
5
+ # Methods for string-like related function
6
+ module VectorStringFunction
7
+ using RefineArray
8
+ using RefineArrayLike
9
+
10
+ # For each string in self, emit true if it contains a given pattern.
11
+ #
12
+ # @overload match_substring(string, ignore_case: nil)
13
+ # Emit true if it contains `string`.
14
+ #
15
+ # @param string [String]
16
+ # string pattern to match.
17
+ # @param ignore_case [boolean]
18
+ # switch whether to ignore case. Ignore case if true.
19
+ # @return [Vector]
20
+ # boolean Vector to show if elements contain a given pattern.
21
+ # nil inputs emit nil.
22
+ # @example Match with string.
23
+ # vector = Vector.new('array', 'Arrow', 'carrot', nil, 'window')
24
+ # vector.match_substring('arr')
25
+ # # =>
26
+ # #<RedAmber::Vector(:boolean, size=5):0x000000000005a208>
27
+ # [true, false, true, nil, false]
28
+ #
29
+ # @overload match_substring(regexp, ignore_case: nil)
30
+ # Emit true if it contains substring matching with `regexp`.
31
+ # It calls `match_substring_regex` in Arrow compute function and
32
+ # uses re2 library.
33
+ #
34
+ # @param regexp [Regexp]
35
+ # regular expression pattern to match. Ruby's Regexp is given and
36
+ # it will passed to Arrow's kernel by its source.
37
+ # @param ignore_case [boolean]
38
+ # switch whether to ignore case. Ignore case if true.
39
+ # When `ignore_case` is false, casefolding option in regexp is priortized.
40
+ # @return [Vector]
41
+ # boolean Vector to show if elements contain a given pattern.
42
+ # nil inputs emit nil.
43
+ # @example Match with regexp.
44
+ # vector.match_substring(/arr/)
45
+ # # =>
46
+ # #<RedAmber::Vector(:boolean, size=5):0x0000000000014b68>
47
+ # [true, false, true, nil, false]
48
+ #
49
+ # @since 0.5.0
50
+ #
51
+ def match_substring(pattern, ignore_case: nil)
52
+ options = Arrow::MatchSubstringOptions.new
53
+ datum =
54
+ case pattern
55
+ when String
56
+ options.ignore_case = (ignore_case || false)
57
+ options.pattern = pattern
58
+ find(:match_substring).execute([data], options)
59
+ when Regexp
60
+ options.ignore_case = (pattern.casefold? || ignore_case || false)
61
+ options.pattern = pattern.source
62
+ find(:match_substring_regex).execute([data], options)
63
+ else
64
+ message =
65
+ "pattern must be either String or Regexp: #{pattern.inspect}"
66
+ raise VectorArgumentError, message
67
+ end
68
+ Vector.create(datum.value)
69
+ end
70
+ alias_method :match_substring?, :match_substring
71
+
72
+ # Check if elements in self end with a literal pattern.
73
+ #
74
+ # @param string [String]
75
+ # string pattern to match.
76
+ # @param ignore_case [boolean]
77
+ # switch whether to ignore case. Ignore case if true.
78
+ # @return [Vector]
79
+ # boolean Vector to show if elements end with a given pattern.
80
+ # nil inputs emit nil.
81
+ # @example Check if end with?.
82
+ # vector = Vector.new('array', 'Arrow', 'carrot', nil, 'window')
83
+ # vector.end_with('ow')
84
+ # # =>
85
+ # #<RedAmber::Vector(:boolean, size=5):0x00000000000108ec>
86
+ # [false, true, false, nil, true]
87
+ # @since 0.5.0
88
+ #
89
+ def end_with(string, ignore_case: nil)
90
+ options = Arrow::MatchSubstringOptions.new
91
+ options.ignore_case = (ignore_case || false)
92
+ options.pattern = string
93
+ datum = find(:ends_with).execute([data], options)
94
+ Vector.create(datum.value)
95
+ end
96
+ alias_method :end_with?, :end_with
97
+
98
+ # Check if elements in self start with a literal pattern.
99
+ #
100
+ # @param string [String]
101
+ # string pattern to match.
102
+ # @param ignore_case [boolean]
103
+ # switch whether to ignore case. Ignore case if true.
104
+ # @return [Vector]
105
+ # boolean Vector to show if elements start with a given pattern.
106
+ # nil inputs emit nil.
107
+ # @example Check if start with?.
108
+ # vector = Vector.new('array', 'Arrow', 'carrot', nil, 'window')
109
+ # vector.start_with('arr')
110
+ # # =>
111
+ # #<RedAmber::Vector(:boolean, size=5):0x00000000000193fc>
112
+ # [true, false, false, nil, false]
113
+ # @since 0.5.0
114
+ #
115
+ def start_with(string, ignore_case: nil)
116
+ options = Arrow::MatchSubstringOptions.new
117
+ options.ignore_case = (ignore_case || false)
118
+ options.pattern = string
119
+ datum = find(:starts_with).execute([data], options)
120
+ Vector.create(datum.value)
121
+ end
122
+ alias_method :start_with?, :start_with
123
+
124
+ # Match elements of self against SQL-style LIKE pattern.
125
+ # The pattern matches a given pattern at any position.
126
+ # '%' will match any number of characters,
127
+ # '_' will match exactly one character,
128
+ # and any other character matches itself.
129
+ # To match a literal '%', '_', or '\', precede the character with a backslash.
130
+ #
131
+ # @param string [String]
132
+ # string pattern to match.
133
+ # @param ignore_case [boolean]
134
+ # switch whether to ignore case. Ignore case if true.
135
+ # @return [Vector]
136
+ # boolean Vector to show if elements start with a given pattern.
137
+ # nil inputs emit nil.
138
+ # @example Check with match_like?.
139
+ # vector = Vector.new('array', 'Arrow', 'carrot', nil, 'window')
140
+ # vector.match_like('_rr%')
141
+ # # =>
142
+ # @since 0.5.0
143
+ #
144
+ def match_like(string, ignore_case: nil)
145
+ options = Arrow::MatchSubstringOptions.new
146
+ options.ignore_case = (ignore_case || false)
147
+ options.pattern = string
148
+ datum = find(:match_like).execute([data], options)
149
+ Vector.create(datum.value)
150
+ end
151
+ alias_method :match_like?, :match_like
152
+
153
+ # For each string in self, count occuerences of substring in given pattern.
154
+ #
155
+ # @overload count_substring(string, ignore_case: nil)
156
+ # Count if it contains `string`.
157
+ #
158
+ # @param string [String]
159
+ # string pattern to count.
160
+ # @param ignore_case [boolean]
161
+ # switch whether to ignore case. Ignore case if true.
162
+ # @return [Vector]
163
+ # int32 or int64 Vector to show if elements contain a given pattern.
164
+ # nil inputs emit nil.
165
+ # @example Count with string.
166
+ # vector2 = Vector.new('amber', 'Amazon', 'banana', nil)
167
+ # vector2.count_substring('an')
168
+ # # =>
169
+ # #<RedAmber::Vector(:int32, size=4):0x000000000003db30>
170
+ # [0, 0, 2, nil]
171
+ #
172
+ # @overload count_substring(regexp, ignore_case: nil)
173
+ # Count if it contains substring matching with `regexp`.
174
+ # It calls `count_substring_regex` in Arrow compute function and
175
+ # uses re2 library.
176
+ #
177
+ # @param regexp [Regexp]
178
+ # regular expression pattern to count. Ruby's Regexp is given and
179
+ # it will passed to Arrow's kernel by its source.
180
+ # @param ignore_case [boolean]
181
+ # switch whether to ignore case. Ignore case if true.
182
+ # When `ignore_case` is false, casefolding option in regexp is priortized.
183
+ # @return [Vector]
184
+ # int32 or int64 Vector to show the counts in given pattern.
185
+ # nil inputs emit nil.
186
+ # @example Count with regexp with case ignored.
187
+ # vector2.count_substring(/a[mn]/i)
188
+ # # =>
189
+ # #<RedAmber::Vector(:int32, size=4):0x0000000000051298>
190
+ # [1, 1, 2, nil]
191
+ # # it is same result as `vector2.count_substring(/a[mn]/, ignore_case: true)`
192
+ #
193
+ # @since 0.5.0
194
+ #
195
+ def count_substring(pattern, ignore_case: nil)
196
+ options = Arrow::MatchSubstringOptions.new
197
+ datum =
198
+ case pattern
199
+ when String
200
+ options.ignore_case = (ignore_case || false)
201
+ options.pattern = pattern
202
+ find(:count_substring).execute([data], options)
203
+ when Regexp
204
+ options.ignore_case = (pattern.casefold? || ignore_case || false)
205
+ options.pattern = pattern.source
206
+ find(:count_substring_regex).execute([data], options)
207
+ else
208
+ message =
209
+ "pattern must be either String or Regexp: #{pattern.inspect}"
210
+ raise VectorArgumentError, message
211
+ end
212
+ Vector.create(datum.value)
213
+ end
214
+
215
+ # Find first occurrence of substring in string Vector.
216
+ #
217
+ # @overload find_substring(string, ignore_case: nil)
218
+ # Emit the index in bytes of the first occurrence of the given
219
+ # literal pattern, or -1 if not found.
220
+ #
221
+ # @param string [String]
222
+ # string pattern to match.
223
+ # @param ignore_case [boolean]
224
+ # switch whether to ignore case. Ignore case if true.
225
+ # @return [Vector]
226
+ # index Vector of occurences.
227
+ # nil inputs emit nil.
228
+ # @example Match with string.
229
+ # vector = Vector['array', 'Arrow', 'carrot', nil, 'window']
230
+ # vector.find_substring('arr')
231
+ # # =>
232
+ # #<RedAmber::Vector(:boolean, size=5):0x00000000000161e8>
233
+ # [0, -1, 1, nil, -1]
234
+ #
235
+ # @overload find_substring(regexp, ignore_case: nil)
236
+ # Emit the index in bytes of the first occurrence of the given
237
+ # regexp pattern, or -1 if not found.
238
+ # It calls `find_substring_regex` in Arrow compute function and
239
+ # uses re2 library.
240
+ #
241
+ # @param regexp [Regexp]
242
+ # regular expression pattern to match. Ruby's Regexp is given and
243
+ # it will passed to Arrow's kernel by its source.
244
+ # @param ignore_case [boolean]
245
+ # switch whether to ignore case. Ignore case if true.
246
+ # When `ignore_case` is false, casefolding option in regexp is priortized.
247
+ # @return [Vector]
248
+ # index Vector of occurences.
249
+ # nil inputs emit nil.
250
+ # @example Match with regexp.
251
+ # vector.find_substring(/arr/i)
252
+ # # or vector.find_substring(/arr/, ignore_case: true)
253
+ # # =>
254
+ # #<RedAmber::Vector(:boolean, size=5):0x000000000001b74c>
255
+ # [0, 0, 1, nil, -1]
256
+ #
257
+ # @since 0.5.1
258
+ #
259
+ def find_substring(pattern, ignore_case: nil)
260
+ options = Arrow::MatchSubstringOptions.new
261
+ datum =
262
+ case pattern
263
+ when String
264
+ options.ignore_case = (ignore_case || false)
265
+ options.pattern = pattern
266
+ find(:find_substring).execute([data], options)
267
+ when Regexp
268
+ options.ignore_case = (pattern.casefold? || ignore_case || false)
269
+ options.pattern = pattern.source
270
+ find(:find_substring_regex).execute([data], options)
271
+ else
272
+ message =
273
+ "pattern must be either String or Regexp: #{pattern.inspect}"
274
+ raise VectorArgumentError, message
275
+ end
276
+ Vector.create(datum.value)
277
+ end
278
+ end
279
+ end
@@ -184,6 +184,8 @@ module RedAmber
184
184
  #
185
185
  # Propagate next valid value backward to previous nil values.
186
186
  # Or nothing if all next values are nil.
187
+ # @note Use `fill_nil(value)` to replace nil by a value.
188
+ # @see #fill_nil
187
189
  # @return [Vector]
188
190
  # a Vector which filled nil backward.
189
191
  # @example
@@ -201,6 +203,8 @@ module RedAmber
201
203
  #
202
204
  # Propagate last valid value backward to next nil values.
203
205
  # Or nothing if all previous values are nil.
206
+ # @note Use `fill_nil(value)` to replace nil by a value.
207
+ # @see #fill_nil
204
208
  # @return [Vector]
205
209
  # a Vector which filled nil forward.
206
210
  # @example
@@ -149,6 +149,22 @@ module RedAmber
149
149
  replace_with(booleans.data, replacer_array)
150
150
  end
151
151
 
152
+ # Replace nil to value.
153
+ #
154
+ # @note Use `fill_nil_backawrd` or `fill_nil_forward` to replace nil
155
+ # by adjacent values.
156
+ # @see #fill_nil_backward
157
+ # @see #fill_nil_forward
158
+ # @param value [scalar]
159
+ # the value to replace with.
160
+ # @return [Vector]
161
+ # replaced Vector
162
+ # @since 0.5.0
163
+ #
164
+ def fill_nil(value)
165
+ is_nil.if_else(value, self)
166
+ end
167
+
152
168
  # Choose values based on self.
153
169
  #
154
170
  # [Ternary element-wise function] Returns a Vector.
@@ -449,6 +465,18 @@ module RedAmber
449
465
  end
450
466
  alias_method :concat, :concatenate
451
467
 
468
+ # Cast self to `type`.
469
+ #
470
+ # @param type [symbol]
471
+ # type to cast.
472
+ # @return [Vector]
473
+ # casted Vector.
474
+ # @since 0.5.0
475
+ #
476
+ def cast(type)
477
+ Vector.create(data.cast(type))
478
+ end
479
+
452
480
  private
453
481
 
454
482
  # Replace elements selected with a boolean mask
@@ -2,5 +2,5 @@
2
2
 
3
3
  module RedAmber
4
4
  # Library version
5
- VERSION = '0.4.2'
5
+ VERSION = '0.5.1'
6
6
  end
data/lib/red_amber.rb CHANGED
@@ -17,9 +17,10 @@ require_relative 'red_amber/group'
17
17
  require_relative 'red_amber/subframes'
18
18
  require_relative 'red_amber/vector_aggregation'
19
19
  require_relative 'red_amber/vector_binary_element_wise'
20
+ require_relative 'red_amber/vector_selectable'
21
+ require_relative 'red_amber/vector_string_function'
20
22
  require_relative 'red_amber/vector_unary_element_wise'
21
23
  require_relative 'red_amber/vector_updatable'
22
- require_relative 'red_amber/vector_selectable'
23
24
  require_relative 'red_amber/vector'
24
25
  require_relative 'red_amber/version'
25
26
 
data/red_amber.gemspec CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.authors = ['Hirokazu SUZUKI (heronshoes)']
9
9
  spec.email = ['heronshoes877@gmail.com']
10
10
 
11
- spec.summary = 'Simple dataframe library for Ruby'
12
- spec.description = 'RedAmber is a simple dataframe library ' \
11
+ spec.summary = 'A data frame library for Rubyists'
12
+ spec.description = 'RedAmber is a data frame library ' \
13
13
  'inspired by Rover-df and powered by Red Arrow.'
14
14
  spec.homepage = 'https://github.com/red-data-tools/red_amber'
15
15
  spec.license = 'MIT'
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
32
32
  spec.require_paths = ['lib']
33
33
 
34
- spec.add_dependency 'red-arrow', '~> 11.0.0'
34
+ spec.add_dependency 'red-arrow', '~> 12.0.0'
35
35
 
36
36
  # Development dependency has gone to the Gemfile (rubygems/bundler#7237)
37
37
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: red_amber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hirokazu SUZUKI (heronshoes)
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-02 00:00:00.000000000 Z
11
+ date: 2023-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: red-arrow
@@ -16,28 +16,32 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 11.0.0
19
+ version: 12.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 11.0.0
27
- description: RedAmber is a simple dataframe library inspired by Rover-df and powered
28
- by Red Arrow.
26
+ version: 12.0.0
27
+ description: RedAmber is a data frame library inspired by Rover-df and powered by
28
+ Red Arrow.
29
29
  email:
30
30
  - heronshoes877@gmail.com
31
31
  executables: []
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
+ - ".devcontainer/Dockerfile"
36
+ - ".devcontainer/devcontainer.json"
37
+ - ".devcontainer/onCreateCommand.sh"
35
38
  - ".rubocop.yml"
36
39
  - ".rubocop_todo.yml"
37
40
  - ".yardopts"
38
41
  - CHANGELOG.md
39
42
  - Gemfile
40
43
  - LICENSE
44
+ - README.ja.md
41
45
  - README.md
42
46
  - Rakefile
43
47
  - benchmark/basic.yml
@@ -55,6 +59,8 @@ files:
55
59
  - doc/CODE_OF_CONDUCT.md
56
60
  - doc/DataFrame.md
57
61
  - doc/DataFrame_Comparison.md
62
+ - doc/Dev_Containers.ja.md
63
+ - doc/Dev_Containers.md
58
64
  - doc/SubFrames.md
59
65
  - doc/Vector.md
60
66
  - doc/image/arrow_table_new.png
@@ -84,17 +90,15 @@ files:
84
90
  - doc/image/vector/unary_aggregation.png
85
91
  - doc/image/vector/unary_aggregation_w_option.png
86
92
  - doc/image/vector/unary_element_wise.png
93
+ - doc/qmd/examples_of_red_amber.qmd
94
+ - doc/qmd/red-amber.qmd
87
95
  - doc/tdr.md
88
96
  - doc/tdr_ja.md
89
97
  - doc/yard-templates/default/fulldoc/html/css/common.css
90
98
  - docker/.env
91
99
  - docker/Dockerfile
92
100
  - docker/Gemfile
93
- - docker/Gemfile.lock
94
101
  - docker/docker-compose.yml
95
- - docker/example
96
- - docker/notebook/examples_of_red_amber.ipynb
97
- - docker/notebook/red-amber.ipynb
98
102
  - docker/readme.md
99
103
  - lib/red-amber.rb
100
104
  - lib/red_amber.rb
@@ -114,6 +118,7 @@ files:
114
118
  - lib/red_amber/vector_aggregation.rb
115
119
  - lib/red_amber/vector_binary_element_wise.rb
116
120
  - lib/red_amber/vector_selectable.rb
121
+ - lib/red_amber/vector_string_function.rb
117
122
  - lib/red_amber/vector_unary_element_wise.rb
118
123
  - lib/red_amber/vector_updatable.rb
119
124
  - lib/red_amber/version.rb
@@ -127,7 +132,7 @@ metadata:
127
132
  source_code_uri: https://github.com/red-data-tools/red_amber
128
133
  changelog_uri: https://github.com/red-data-tools/red_amber/blob/main/CHANGELOG.md
129
134
  rubygems_mfa_required: 'true'
130
- post_install_message:
135
+ post_install_message:
131
136
  rdoc_options: []
132
137
  require_paths:
133
138
  - lib
@@ -143,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
148
  version: '0'
144
149
  requirements: []
145
150
  rubygems_version: 3.4.10
146
- signing_key:
151
+ signing_key:
147
152
  specification_version: 4
148
- summary: Simple dataframe library for Ruby
153
+ summary: A data frame library for Rubyists
149
154
  test_files: []
data/docker/Gemfile.lock DELETED
@@ -1,80 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
- benchmark-ips (2.12.0)
5
- benchmark_driver (0.16.3)
6
- bigdecimal (3.1.4)
7
- concurrent-ruby (1.2.2)
8
- csv (3.2.6)
9
- extpp (0.1.1)
10
- faker (3.1.1)
11
- i18n (>= 1.8.11, < 2)
12
- fiddle (1.1.1)
13
- gio2 (4.1.2)
14
- fiddle
15
- gobject-introspection (= 4.1.2)
16
- glib2 (4.1.2)
17
- native-package-installer (>= 1.0.3)
18
- pkg-config (>= 1.3.5)
19
- gobject-introspection (4.1.2)
20
- glib2 (= 4.1.2)
21
- i18n (1.12.0)
22
- concurrent-ruby (~> 1.0)
23
- io-console (0.6.0)
24
- irb (1.6.3)
25
- reline (>= 0.3.0)
26
- libui (0.0.15)
27
- native-package-installer (1.1.5)
28
- numo-narray (0.9.2.1)
29
- pkg-config (1.5.1)
30
- red-amber-view (0.0.1)
31
- libui
32
- red-arrow
33
- red_amber
34
- red-arrow (11.0.0)
35
- bigdecimal (>= 3.1.0)
36
- extpp (>= 0.1.1)
37
- gio2 (>= 3.5.0)
38
- native-package-installer
39
- pkg-config
40
- red-arrow-numo-narray (0.0.6)
41
- numo-narray
42
- red-arrow
43
- red-datasets (0.1.5)
44
- csv (>= 3.2.4)
45
- rexml
46
- rubyzip
47
- red-datasets-arrow (0.0.3)
48
- red-arrow
49
- red-datasets (>= 0.0.3)
50
- red-parquet (11.0.0)
51
- red-arrow (= 11.0.0)
52
- red_amber (0.4.1)
53
- red-arrow (~> 11.0.0)
54
- reline (0.3.2)
55
- io-console (~> 0.5)
56
- rexml (3.2.5)
57
- rover-df (0.3.4)
58
- numo-narray (>= 0.9.1.9)
59
- rubyzip (2.3.2)
60
-
61
- PLATFORMS
62
- x86_64-linux
63
-
64
- DEPENDENCIES
65
- benchmark-ips
66
- benchmark_driver
67
- faker
68
- irb
69
- numo-narray
70
- red-amber-view
71
- red-arrow (~> 11.0.0)
72
- red-arrow-numo-narray
73
- red-datasets
74
- red-datasets-arrow
75
- red-parquet (~> 11.0.0)
76
- red_amber (>= 0.4.1)
77
- rover-df
78
-
79
- BUNDLED WITH
80
- 2.4.8
data/docker/example DELETED
@@ -1,74 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- $stderr.print "starting.\r"
5
-
6
- require 'bundler/setup'
7
-
8
- $stderr.print "starting..\r"
9
- require 'red_amber'
10
- include RedAmber
11
-
12
- $stderr.print "starting...\r"
13
- require 'datasets-arrow'
14
-
15
- $stderr.print "reading penguins...\r"
16
- penguins = DataFrame.new(Datasets::Penguins.new)
17
-
18
- $stderr.print "reading diamonds...\r"
19
- diamonds = DataFrame.new(Datasets::Diamonds.new)
20
-
21
- $stderr.print "reading starwars...\r"
22
- starwars = DataFrame.new(Datasets::Rdataset.new('dplyr', 'starwars'))
23
-
24
- $stderr.print "reading openintro/simpsons_paradox_covid...\r"
25
- ds = Datasets::Rdataset.new('openintro', 'simpsons_paradox_covid')
26
- simpsons_paradox_covid = DataFrame.new(ds.to_arrow)
27
-
28
- $stderr.print "reading mtcars... \r"
29
- mtcars = DataFrame.new(Datasets::Rdatasets.new('datasets', 'mtcars'))
30
-
31
- $stderr.print "reading iris... \r"
32
- iris = DataFrame.new(Datasets::Iris.new)
33
-
34
- $stderr.print "reading band_members...\r"
35
- band_members = DataFrame.new(Datasets::Rdatasets.new('dplyr', 'band_members'))
36
-
37
- $stderr.print "reading band_instruments...\r"
38
- band_instruments = DataFrame.new(Datasets::Rdatasets.new('dplyr', 'band_instruments'))
39
-
40
- $stderr.print "reading band_instruments2...\r"
41
- band_instruments2 = DataFrame.new(Datasets::Rdatasets.new('dplyr', 'band_instruments2'))
42
-
43
- $stderr.print "reading import_cars... \r"
44
- import_cars = DataFrame.load(Arrow::Buffer.new(<<~TSV), format: :tsv)
45
- Year Audi BMW BMW_MINI Mercedes-Benz VW
46
- 2017 28336 52527 25427 68221 49040
47
- 2018 26473 50982 25984 67554 51961
48
- 2019 24222 46814 23813 66553 46794
49
- 2020 22304 35712 20196 57041 36576
50
- 2021 22535 35905 18211 51722 35215
51
- TSV
52
-
53
- $stderr.print "reading comecome... \r"
54
- comecome = DataFrame.load(Arrow::Buffer.new(<<~CSV), format: :csv)
55
- name,age
56
- Yasuko,68
57
- Rui,49
58
- Hinata,28
59
- CSV
60
-
61
- $stderr.print "reading general dataframe and subframes...\r"
62
- dataframe = DataFrame.new(
63
- x: [*1..6],
64
- y: %w[A A B B B C],
65
- z: [false, true, false, nil, true, false]
66
- )
67
- subframes = SubFrames.new(dataframe, [[0, 1], [2, 3, 4], [5]])
68
-
69
- # Welcome to RedAmber example!
70
- # This environment will offer these pre-loaded datasets:
71
- # penguins, diamonds, iris, starwars, simpsons_paradox_covid,
72
- # mtcars, band_members, band_instruments, band_instruments2
73
- # (original) import_cars, comecome, dataframe, subframes
74
- binding.irb