pdtable 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/lib/pdtable/pdtable.rb +1 -1
- data/lib/pdtable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efa157e295c09895d46af88ab10d82bc9d1eae49
|
4
|
+
data.tar.gz: dc08526f99df4e1ab0be1e5cfedea8fe44cca3d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 884417e4c97205a05fd69316d4cce1ad77c9dd864dd3e3ec3e697df7679be34f70e28d670b2ed36fd51f42865e6b05950fb286f56693a381cb0b065f65063416
|
7
|
+
data.tar.gz: '0349127c0cca59429a52edc6db00419cd5a1e73a5f308f1484737278b26929d64016faefd44dbd0d5d650204c7850ede9ed2fe3b8c56bb9bce7370387d16a502'
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
### Read CSV
|
24
24
|
|
25
|
-
You can read CSV with `Pdtable::
|
25
|
+
You can read CSV with `Pdtable::Table.new`.
|
26
26
|
|
27
27
|
```sh
|
28
28
|
$ cat test/csv/default.csv
|
@@ -33,8 +33,8 @@ date,datetime,integer,float,string
|
|
33
33
|
```
|
34
34
|
|
35
35
|
```ruby
|
36
|
-
> t = Pdtable::
|
37
|
-
=> #<Pdtable::
|
36
|
+
> t = Pdtable::Table.new 'test/csv/default.csv'
|
37
|
+
=> #<Pdtable::Table mode:col_or_row row_count:4>
|
38
38
|
|
39
39
|
> puts t
|
40
40
|
date,datetime,integer,float,string
|
@@ -57,14 +57,14 @@ date,datetime,integer,float,string
|
|
57
57
|
### Options
|
58
58
|
|
59
59
|
```ruby
|
60
|
-
> t = Pdtable::
|
61
|
-
=> #<Pdtable::
|
60
|
+
> t = Pdtable::Table.new 'test/csv/default.csv', dtype: {date: Date, float: String}
|
61
|
+
=> #<Pdtable::Table mode:col_or_row row_count:4>
|
62
62
|
|
63
63
|
> t.to_a
|
64
64
|
=> [[:date, :datetime, :integer, :float, :string], [#<Date: 2017-01-01 ((2457755j,0s,0n),+0s,2299161j)>, #<DateTime: 2017-01-01T00:00:00+00:00 ((2457755j,0s,0n),+0s,2299161j)>, 1, "1.1", "string1"], [#<Date: 2017-01-02 ((2457756j,0s,0n),+0s,2299161j)>, #<DateTime: 2017-01-02T00:00:00+00:00 ((2457756j,0s,0n),+0s,2299161j)>, 2, "2.2", "string2"], [#<Date: 2017-01-03 ((2457757j,0s,0n),+0s,2299161j)>, nil, 3, "3.3", "string3"]]
|
65
65
|
|
66
|
-
> t = Pdtable::
|
67
|
-
=> #<Pdtable::
|
66
|
+
> t = Pdtable::Table.new 'test/csv/default.csv', skiprows: 0
|
67
|
+
=> #<Pdtable::Table mode:col_or_row row_count:3>
|
68
68
|
|
69
69
|
> puts t
|
70
70
|
date,datetime,integer,float,string
|
@@ -72,8 +72,8 @@ date,datetime,integer,float,string
|
|
72
72
|
2017-01-03T00:00:00+00:00,,3,3.3,string3
|
73
73
|
=> nil
|
74
74
|
|
75
|
-
> t = Pdtable::
|
76
|
-
=> #<Pdtable::
|
75
|
+
> t = Pdtable::Table.new 'test/csv/default.csv', skiprows: [1, 2]
|
76
|
+
=> #<Pdtable::Table mode:col_or_row row_count:2>
|
77
77
|
|
78
78
|
> puts t
|
79
79
|
date,datetime,integer,float,string
|
data/lib/pdtable/pdtable.rb
CHANGED
data/lib/pdtable/version.rb
CHANGED