Array::Transpose - Transposes a 2-Dimensional Array
use Array::Transpose; @array=transpose(\@array); use Array::Transpose qw{}; @array=Array::Transpose::transpose(\@array);
Example:
use Array::Transpose; use Data::Dumper; my $array=transpose([ [ 0 .. 4 ], ["a" .. "e"], ]); print Data::Dumper->Dump([$array]);
Returns
$VAR1 = [ [ 0, 'a' ], [ 1, 'b' ], [ 2, 'c' ], [ 3, 'd' ], [ 4, 'e' ] ];
This package exports one function named transpose.
In linear algebra, the transpose of a matrix A is another matrix A' created by any one of the following equivalent actions:
write the rows of A as the columns of A'
write the columns of A as the rows of A'
reflect A by its main diagonal (which starts from the top left) to obtain A'
use Array::Transpose; @array=transpose(\@array);
Returns a transposed 2-Dimensional Array given a 2-Dimensional Array
my $out=transpose($in); #$in=[[],[],[],...]; my @out=transpose(\@in); #@in=([],[],[],...);
The transpose function assumes all rows have the same number of columns as the first row.
Please log on RT and send an email to the author.
DavisNetworks.com supports all Perl applications including this package.
Michael R. Davis CPAN ID: MRDVT STOP, LLC domain=>stopllc,tld=>com,account=>mdavis http://www.stopllc.com/
This program is free software licensed under the...
The BSD License
The full text of the license can be found in the LICENSE file included with this module.
Math::MatrixReal method transpose, Data::Table rotate method
Array::Transpose::Ragged
To install Array::Transpose, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Array::Transpose
CPAN shell
perl -MCPAN -e shell install Array::Transpose
For more information on module installation, please visit the detailed CPAN module installation guide.