easy_sheet_io 0.4.7.1 → 0.4.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a53b3053320aed73cc23e53314ddbad656a0d7567f9012a4bf1388c7e44958c0
4
- data.tar.gz: 971ad3bfc3a5211493c31886a5487f5f19a4ddda8b7a71a5be3c4a6cf10d2761
3
+ metadata.gz: e65974883f0073ff5143f8a036c9520b626a0cad96f0ee6ae34162fcd433321e
4
+ data.tar.gz: 394938c7240e743fac49ceaf145f4abf05f8b6538bd60b273ecce892b6255bda
5
5
  SHA512:
6
- metadata.gz: 4b24c4ffdb2c549ab9457362c0d16234808f3b98e8140e1a656771749203aee0fd2d8aafd90590c98ffc19358eda892cc45e4887702884560c92cc7950101a75
7
- data.tar.gz: 952d816e49b326fb3b266a5ae00ff4d649b337e080451ca348068975b333384f311b59471db41084cdee584746e43fd9a88c34b2b91b6ec94834eb5147d1f875
6
+ metadata.gz: 4c568bf3027c08cf2c1a404e5bf72314a776ba2f79a13e4e492928a44147189fd25f368cc454fd7e85aa011c6fa7707c84943629ad2e4c3c837efad0db6a9aaf
7
+ data.tar.gz: e5505db874dd91ff7216d80b884e9ead751b9caeacd0e2fd07973ef2dcfc154ba57361d1d839e5f519f313cf7b6404730dfa3eca2a98c5d1c993d2d4b588f10e
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EasySheetIo
4
- VERSION = "0.4.7.1"
4
+ VERSION = "0.4.8"
5
5
  end
data/lib/easy_sheet_io.rb CHANGED
@@ -71,8 +71,9 @@ module EasySheetIo
71
71
 
72
72
  # Convert 2d Array to Hash
73
73
  ## header: nil -> Default Headers(:column1, column2,...) are generated.
74
- ## Option line_ignored is not implemented yet.
74
+ ## Option line_ignored, is not implemented yet.
75
75
  def to_hash(array2d, line_from: 1, line_until: nil, line_ignored: nil,
76
+ column_from: nil, column_until: nil,
76
77
  header: 0, symbol_header: false,
77
78
  replaced_by_nil: [], analyze_type: true)
78
79
  ## TODO.. column_from: , column_until:
@@ -86,10 +87,15 @@ module EasySheetIo
86
87
  lfrom = lines_ary.find_index{ line_from === _1 } if lf_reg
87
88
  luntil = (lines_ary.length-1) - lines_ary.reverse.find_index{ line_until === _1 } if lu_reg
88
89
  end
90
+
91
+ # And get originally array-----
92
+ output = array2d[lfrom...luntil]
89
93
  # -----------------------------
94
+
95
+ # Selecct Column---------------
96
+ output = output.map { _1[column_from...column_until] } column_from || column_until
90
97
 
91
98
  # Define Data Array------------
92
- output = array2d[lfrom...luntil]
93
99
  output_transpose = output[0].zip(*output[1..])
94
100
  output_transpose = fix_array(output_transpose, replaced_by_nil, analyze_type)
95
101
  # -----------------------------
data/lib/to_csv.rb CHANGED
@@ -51,7 +51,13 @@ class Daru::DataFrame
51
51
  # rover not suppoted yet about indexing
52
52
  def set_index!(indexcolumn)
53
53
  self.index = self[indexcolumn]
54
- end
54
+ end
55
+
56
+ # To revice pivot index
57
+ def simplify_multi_index(vector_names_ary)
58
+ self.vectors = Daru::Index.new(vector_names_ary)
59
+ self.index = Daru::Vector.new(self.index.to_a.map{_1[0]})
60
+ end
55
61
 
56
62
  alias_method :addvec, :add_vector
57
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_sheet_io
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7.1
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - show-o-atakun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-23 00:00:00.000000000 Z
11
+ date: 2023-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: daru