るりまサーチ

最速Rubyリファレンスマニュアル検索!
1279件ヒット [1-100件を表示] (0.098秒)
トップページ > クエリ:-[x] > クエリ:ruby[x] > クエリ:row[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Matrix#row(i) -> Vector | nil (18232.0)

i 番目の行を Vector オブジェクトで返します。 i 番目の行が存在しない場合は nil を返します。 ブロックが与えられた場合はその行の各要素についてブロックを繰り返します。

...のインデックスと見倣します。末尾の行が -1 番目になります。

//emlist[例][ruby]{
require 'matrix'
a1 = [1, 2, 3]
a2 = [10, 15, 20]
a3 = [-1, -2, 1.5]
m = Matrix[a1, a2, a3]

p m.row(1) # => Vector[10, 15, 20]

cnt = 0
m.row(0) { |x|
cnt = cnt + x
}
p cnt # => 6
//}...

Matrix#row(i) {|x| ... } -> self (18232.0)

i 番目の行を Vector オブジェクトで返します。 i 番目の行が存在しない場合は nil を返します。 ブロックが与えられた場合はその行の各要素についてブロックを繰り返します。

...のインデックスと見倣します。末尾の行が -1 番目になります。

//emlist[例][ruby]{
require 'matrix'
a1 = [1, 2, 3]
a2 = [10, 15, 20]
a3 = [-1, -2, 1.5]
m = Matrix[a1, a2, a3]

p m.row(1) # => Vector[10, 15, 20]

cnt = 0
m.row(0) { |x|
cnt = cnt + x
}
p cnt # => 6
//}...

CSV::Row#field_row? -> bool (9255.0)

フィールド行であれば真を返します。そうでなければ偽を返します。

...ド行であれば真を返します。そうでなければ偽を返します。

//emlist[例][ruby]{
require "csv"

header_row = CSV::Row.new(["header1", "header2"], [], true)
row
= CSV::Row.new(["header1", "header2"], [1, 2])
header_row.field_row? # => false
row
.field_row? # => true
//}...

CSV::Row#header_row? -> bool (9255.0)

ヘッダ行であれば真を返します。そうでなければ偽を返します。

...行であれば真を返します。そうでなければ偽を返します。

//emlist[例][ruby]{
require "csv"

header_row = CSV::Row.new(["header1", "header2"], [], true)
row
= CSV::Row.new(["header1", "header2"], [1, 2])
header_row.header_row? # => true
row
.header_row? # => false
//}...

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

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

...emlist[例][ruby]{
require "csv"

row
1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row
2 = 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:row 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 (6333.0)

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

...//emlist[例][ruby]{
require "csv"

row
1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row
2 = 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#by_col_or_row -> CSV::Table (6309.0)

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

...][ruby]{
require "csv"

row
1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row
2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1, row2]).by_col!
table # => #<CSV::Table mode:col row_count:3>
col_or_row_table = table.by_col_or_row
co...
...l_or_row_table # => #<CSV::Table mode:col_or_row row_count:3>
table # => #<CSV::Table mode:col row_count:3>
//}...

Matrix.rows(rows, copy = true) -> Matrix (6306.0)

引数 rows を行ベクトルの列とする行列を生成します。

...引数 rows を行ベクトルの列とする行列を生成します。

引数 copy が偽(false)ならば、rows の複製を行いません。

//emlist[例][ruby]{
require 'matrix'

a1 = [1, 2, 3]
a2 = [10, 15, 20]

m = Matrix.rows([a1, a2], false) # 配列を複製せずに行列を生成
p m...
...# => Matrix[[1, 2, 3], [10, 15, 20]]
a2[1] = 1000 # 配列のデータを変更
p m # => Matrix[[1, 2, 3], [10, 1000, 20]]
//}

@param rows 配列の配列
@param copy 配列を複製するかどうかを真偽値で指定...

CSV::Table#by_col_or_row! -> self (6291.0)

自身をミックスモードに変更します。

...emlist[例][ruby]{
require "csv"

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

CSV#row_sep -> String (6243.0)

行区切り文字列として使用する文字列を返します。

...行区切り文字列として使用する文字列を返します。

//emlist[例][ruby]{
require "csv"

csv = CSV.new("header1,header2|row1_1,row1_2", row_sep: "|")
csv.row_sep # => "|"
csv.read # => [["header1", "header2"], ["row1_1", "row1_2"]]
//}

@see CSV.new...

絞り込み条件を変える

<< 1 2 3 ... > >>