[DOC] Tweaks for Array#transpose
This commit is contained in:
parent
979e447d7e
commit
2078ba1984
Notes:
git
2024-10-24 21:23:41 +00:00
9
array.c
9
array.c
@ -4494,14 +4494,17 @@ rb_ary_zip(int argc, VALUE *argv, VALUE ary)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* call-seq:
|
||||||
* array.transpose -> new_array
|
* transpose -> new_array
|
||||||
*
|
*
|
||||||
* Transposes the rows and columns in an +Array+ of Arrays;
|
* Returns a new array that is +self+
|
||||||
* the nested Arrays must all be the same size:
|
* as a {transposed matrix}[https://en.wikipedia.org/wiki/Transpose]:
|
||||||
*
|
*
|
||||||
* a = [[:a0, :a1], [:b0, :b1], [:c0, :c1]]
|
* a = [[:a0, :a1], [:b0, :b1], [:c0, :c1]]
|
||||||
* a.transpose # => [[:a0, :b0, :c0], [:a1, :b1, :c1]]
|
* a.transpose # => [[:a0, :b0, :c0], [:a1, :b1, :c1]]
|
||||||
*
|
*
|
||||||
|
* The elements of +self+ must all be the same size.
|
||||||
|
*
|
||||||
|
* Related: see {Methods for Converting}[rdoc-ref:Array@Methods+for+Converting].
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user