Feature #5145

Function extension of Array#transpose

Added by Makoto Kishimoto over 2 years ago. Updated over 1 year ago.

[ruby-core:38701]
Status:Feedback
Priority:Low
Assignee:-
Category:core
Target version:next minor

Description

Currently, Array#transpose doesn't transpose iliffe vector that
size of arrays in array are not same.

But iff the sequence of size is monotone nonincreasing, there is
natural transposition.

[[1, 2, 3], [4, 5], [6]].transpose
=> [[1, 4, 6], [2, 5], [3]]

Attachment is monkey patch implementation by Ruby .

array-transpose.rb Magnifier (821 Bytes) Makoto Kishimoto, 08/02/2011 05:28 PM

History

#1 Updated by Yusuke Endoh about 2 years ago

  • Status changed from Open to Feedback

Interesting but do you have any use case?

Yusuke Endoh mame@tsg.ne.jp

#2 Updated by Yutaka HARA over 1 year ago

  • Target version changed from 2.0.0 to next minor

Also available in: Atom PDF