red-datasets-daru 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +33 -0
- data/Rakefile +8 -0
- data/lib/datasets-daru.rb +13 -0
- data/lib/datasets-daru/version.rb +3 -0
- data/red-datasets-daru.gemspec +40 -0
- data/test/helper.rb +3 -0
- data/test/run-test.rb +16 -0
- data/test/test-daru.rb +30 -0
- metadata +129 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9392593bb91b6439496df75debde9d4b12294532bf8447b1a025e6ea203fe452
|
4
|
+
data.tar.gz: cf7165ce26016f136304f03d22eff0105e0853b9fd51272efded3f437b76ebd1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 53336ec3c8e24055f329eba1e4ed5ee09eb54c5d8d34db73539c84b2bc7b2c7f96c97273633e7a7230f5b5c223cfbbac4a87dfc5b1cd326ad529340dd8fea9ee
|
7
|
+
data.tar.gz: aea4861e1ecadd78ee08f977c3a4ec8b5edcc61d4257deb7b76367ac13bff75ae74d185642a82995502874256e09e4eae339957dcd92e89436f93ee5b374a918
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Kenta Murata
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/red-data-tools/red-datasets-daru.svg?branch=master)](https://travis-ci.org/red-data-tools/red-datasets-daru)
|
2
|
+
|
3
|
+
# README
|
4
|
+
|
5
|
+
## Nane
|
6
|
+
|
7
|
+
Red Datasets Daru
|
8
|
+
|
9
|
+
## Description
|
10
|
+
|
11
|
+
Red Datasets Daru provides the way to export a Red Datasets object as Daru::DataFrame object.
|
12
|
+
|
13
|
+
Red Datasets Daru adds `#to_daru` method to each dataset in Red Datasets. Using this method, you can obtain dataset as an object of `Daru::DataFrame` class, which is provided by [daru](https://github.com/sciruby/daru).
|
14
|
+
|
15
|
+
## Install
|
16
|
+
|
17
|
+
```console
|
18
|
+
gem install red-datasets-daru
|
19
|
+
```
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require "datasets/daru"
|
25
|
+
|
26
|
+
iris = Datasets::Iris.new
|
27
|
+
iris_df = iris.to_daru
|
28
|
+
puts iris_df.head
|
29
|
+
```
|
30
|
+
|
31
|
+
## License
|
32
|
+
|
33
|
+
The MIT License. See `LICENSE.txt` for the details.
|
data/Rakefile
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
require "datasets-daru/version"
|
4
|
+
|
5
|
+
clean_white_space = lambda do |entry|
|
6
|
+
entry.gsub(/(\A\n+|\n+\z)/, '') + "\n"
|
7
|
+
end
|
8
|
+
|
9
|
+
Gem::Specification.new do |spec|
|
10
|
+
spec.name = "red-datasets-daru"
|
11
|
+
spec.version = DatasetsDaru::VERSION
|
12
|
+
spec.homepage = "https://github.com/red-data-tools/red-datasets-daru"
|
13
|
+
spec.authors = ["Kenta Murata"]
|
14
|
+
spec.email = ["mrkn@mrkn.jp"]
|
15
|
+
|
16
|
+
readme = File.read("README.md")
|
17
|
+
readme.force_encoding('UTF-8')
|
18
|
+
entries = readme.split(/^\#\#\s(.*)$/)
|
19
|
+
clean_white_space.call(entries[entries.index("Description") + 1])
|
20
|
+
description = clean_white_space.call(entries[entries.index("Description") + 1])
|
21
|
+
spec.summary, spec.description, = description.split(/\n\n+/, 3)
|
22
|
+
spec.license = "MIT"
|
23
|
+
|
24
|
+
spec.files = [
|
25
|
+
"README.md",
|
26
|
+
"LICENSE.txt",
|
27
|
+
"Rakefile",
|
28
|
+
"Gemfile",
|
29
|
+
"#{spec.name}.gemspec",
|
30
|
+
]
|
31
|
+
spec.files += Dir.glob("lib/**/*.rb")
|
32
|
+
spec.files += Dir.glob("test/**/*")
|
33
|
+
|
34
|
+
spec.add_runtime_dependency "daru"
|
35
|
+
spec.add_runtime_dependency "red-datasets", ">= 0.0.3"
|
36
|
+
|
37
|
+
spec.add_development_dependency "bundler"
|
38
|
+
spec.add_development_dependency "rake"
|
39
|
+
spec.add_development_dependency "test-unit"
|
40
|
+
end
|
data/test/helper.rb
ADDED
data/test/run-test.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$VERBOSE = true
|
4
|
+
|
5
|
+
require 'pathname'
|
6
|
+
|
7
|
+
base_dir = Pathname(__FILE__).dirname.parent.expand_path
|
8
|
+
|
9
|
+
lib_dir = base_dir/'lib'
|
10
|
+
test_dir = base_dir/'test'
|
11
|
+
|
12
|
+
$LOAD_PATH.unshift(lib_dir.to_s)
|
13
|
+
|
14
|
+
require_relative 'helper'
|
15
|
+
|
16
|
+
exit(Test::Unit::AutoRunner.run(true, test_dir.to_s))
|
data/test/test-daru.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
class DaruTest < Test::Unit::TestCase
|
2
|
+
def setup
|
3
|
+
@dataset = Datasets::Iris.new
|
4
|
+
end
|
5
|
+
|
6
|
+
test('#to_daru') do
|
7
|
+
result = @dataset.to_daru
|
8
|
+
assert_kind_of(::Daru::DataFrame, result)
|
9
|
+
assert_equal(<<-TABLE.chomp, result.inspect)
|
10
|
+
#<Daru::DataFrame(150x5)>
|
11
|
+
sepal_leng sepal_widt petal_leng petal_widt class
|
12
|
+
0 5.1 3.5 1.4 0.2 Iris-setos
|
13
|
+
1 4.9 3.0 1.4 0.2 Iris-setos
|
14
|
+
2 4.7 3.2 1.3 0.2 Iris-setos
|
15
|
+
3 4.6 3.1 1.5 0.2 Iris-setos
|
16
|
+
4 5.0 3.6 1.4 0.2 Iris-setos
|
17
|
+
5 5.4 3.9 1.7 0.4 Iris-setos
|
18
|
+
6 4.6 3.4 1.4 0.3 Iris-setos
|
19
|
+
7 5.0 3.4 1.5 0.2 Iris-setos
|
20
|
+
8 4.4 2.9 1.4 0.2 Iris-setos
|
21
|
+
9 4.9 3.1 1.5 0.1 Iris-setos
|
22
|
+
10 5.4 3.7 1.5 0.2 Iris-setos
|
23
|
+
11 4.8 3.4 1.6 0.2 Iris-setos
|
24
|
+
12 4.8 3.0 1.4 0.1 Iris-setos
|
25
|
+
13 4.3 3.0 1.1 0.1 Iris-setos
|
26
|
+
14 5.8 4.0 1.2 0.2 Iris-setos
|
27
|
+
... ... ... ... ... ...
|
28
|
+
TABLE
|
29
|
+
end
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: red-datasets-daru
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kenta Murata
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-03-27 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: daru
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: red-datasets
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.0.3
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.0.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: test-unit
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: 'Red Datasets Daru adds `#to_daru` method to each dataset in Red Datasets. Using
|
84
|
+
this method, you can obtain dataset as an object of `Daru::DataFrame` class, which
|
85
|
+
is provided by [daru](https://github.com/sciruby/daru).
|
86
|
+
|
87
|
+
'
|
88
|
+
email:
|
89
|
+
- mrkn@mrkn.jp
|
90
|
+
executables: []
|
91
|
+
extensions: []
|
92
|
+
extra_rdoc_files: []
|
93
|
+
files:
|
94
|
+
- Gemfile
|
95
|
+
- LICENSE.txt
|
96
|
+
- README.md
|
97
|
+
- Rakefile
|
98
|
+
- lib/datasets-daru.rb
|
99
|
+
- lib/datasets-daru/version.rb
|
100
|
+
- red-datasets-daru.gemspec
|
101
|
+
- test/helper.rb
|
102
|
+
- test/run-test.rb
|
103
|
+
- test/test-daru.rb
|
104
|
+
homepage: https://github.com/red-data-tools/red-datasets-daru
|
105
|
+
licenses:
|
106
|
+
- MIT
|
107
|
+
metadata: {}
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
require_paths:
|
111
|
+
- lib
|
112
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - ">="
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
requirements:
|
119
|
+
- - ">="
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
requirements: []
|
123
|
+
rubyforge_project:
|
124
|
+
rubygems_version: 2.7.4
|
125
|
+
signing_key:
|
126
|
+
specification_version: 4
|
127
|
+
summary: Red Datasets Daru provides the way to export a Red Datasets object as Daru::DataFrame
|
128
|
+
object.
|
129
|
+
test_files: []
|