るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
5件ヒット [1-5件を表示] (0.060秒)

別のキーワード

  1. bigdecimal mode
  2. openssl fips_mode=
  3. bigdecimal round_mode
  4. readline vi_editing_mode
  5. readline emacs_editing_mode

クラス

キーワード

検索結果

CSV::Table#by_row -> CSV::Table (63667.0)

ロウモードになっている新しい CSV::Table オブジェクトを返します。

...ロウモードになっている新しい CSV::Table オブジェクトを返します。

元のテーブルモードを変更せずにメソッドチェーンできるので便利です。しか
し、大きなデータセットに対しても同じだけメモリを消費するので気をつ...
...by]{
require "csv"

row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table # => #<CSV::Table mode:col_or_row row_count:3>
row_table = table.by_row # => #<CSV::Table mode:r...
...ow row_count:3>
row_table[0] # => #<CSV::Row "header1":"row1_1" "header2":"row1_2">
row_table[1] # => #<CSV::Row "header1":"row2_1" "header2":"row2_2">
//}...

CSV::Table#by_row! -> self (27667.0)

自身をロウモードに変更します。

...y]{
require "csv"

row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])
table # => #<CSV::Table mode:col_or_row row_count:3>
table.by_row!
table # => #<CSV::Table mode:...
...row row_count:3>
table[0] # => #<CSV::Row "header1":"row1_1" "header2":"row1_2">
table[1] # => #<CSV::Row "header1":"row2_1" "header2":"row2_2">
//}...

CSV::Table#[](header) -> [String] | [nil] (9400.0)

ミックスモードでは、このメソッドは引数に行番号を指定すれば行単位で動作 し、ヘッダの名前を指定すれば列単位で動作します。

...ヘッダの名前を指定すれば列単位で動作します。

このメソッドを呼び出す前に CSV::Table#by_col! を呼び出すとカラム
モードになります。また CSV::Table#by_row! を呼び出すとロウモード
になります。

@param index ミックスモード・...
...][ruby]{
require "csv"

row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])

# ミックスモード
p table.mode # => :col_or_row
p table[0] # => #<CSV::Row "header1":"...
...row1_1" "header2":"row1_2">
p table[1] # => #<CSV::Row "header1":"row2_1" "header2":"row2_2">
p table["header2"] # => ["row1_2", "row2_2"]
p table[0..1] # => [#<CSV::Row "header1":"row1_1" "header2":"row1_2">, #<CSV::Row "header1":"row2_1" "header2":"row2_2">]

# カラムモード
tabl...

CSV::Table#[](index) -> CSV::Row | [String] | nil (9400.0)

ミックスモードでは、このメソッドは引数に行番号を指定すれば行単位で動作 し、ヘッダの名前を指定すれば列単位で動作します。

...ヘッダの名前を指定すれば列単位で動作します。

このメソッドを呼び出す前に CSV::Table#by_col! を呼び出すとカラム
モードになります。また CSV::Table#by_row! を呼び出すとロウモード
になります。

@param index ミックスモード・...
...][ruby]{
require "csv"

row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])

# ミックスモード
p table.mode # => :col_or_row
p table[0] # => #<CSV::Row "header1":"...
...row1_1" "header2":"row1_2">
p table[1] # => #<CSV::Row "header1":"row2_1" "header2":"row2_2">
p table["header2"] # => ["row1_2", "row2_2"]
p table[0..1] # => [#<CSV::Row "header1":"row1_1" "header2":"row1_2">, #<CSV::Row "header1":"row2_1" "header2":"row2_2">]

# カラムモード
tabl...

CSV::Table#[](range) -> [CSV::Row]| [Array] | nil (9400.0)

ミックスモードでは、このメソッドは引数に行番号を指定すれば行単位で動作 し、ヘッダの名前を指定すれば列単位で動作します。

...ヘッダの名前を指定すれば列単位で動作します。

このメソッドを呼び出す前に CSV::Table#by_col! を呼び出すとカラム
モードになります。また CSV::Table#by_row! を呼び出すとロウモード
になります。

@param index ミックスモード・...
...][ruby]{
require "csv"

row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2])

# ミックスモード
p table.mode # => :col_or_row
p table[0] # => #<CSV::Row "header1":"...
...row1_1" "header2":"row1_2">
p table[1] # => #<CSV::Row "header1":"row2_1" "header2":"row2_2">
p table["header2"] # => ["row1_2", "row2_2"]
p table[0..1] # => [#<CSV::Row "header1":"row1_1" "header2":"row1_2">, #<CSV::Row "header1":"row2_1" "header2":"row2_2">]

# カラムモード
tabl...

絞り込み条件を変える