J
Jack
Hi I have data in a multidim array and DONT want to create another
array representing just 1 column from this multidim array.. I want to
determine the number of uniques, I did this easily with just a regular
array (code below), does anyone know how to do this over just 1 column
of a multidim array (in other words, number of uniques across 1 column
of the multi dim defined as: multidim[0][0],multidim[1][0],
multidim[2][0].... etc)
sort @$columnarray;
@out = grep($_ ne $prev && ($prev = $_, 1), @$columnarray);
if ($#out == -1) { $#out = 0; }
$out = $#out +1; # makes $#out of 0 = 1 so it gets counted !
push @distinctcounts, $out;
Thanks!
Jack
array representing just 1 column from this multidim array.. I want to
determine the number of uniques, I did this easily with just a regular
array (code below), does anyone know how to do this over just 1 column
of a multidim array (in other words, number of uniques across 1 column
of the multi dim defined as: multidim[0][0],multidim[1][0],
multidim[2][0].... etc)
sort @$columnarray;
@out = grep($_ ne $prev && ($prev = $_, 1), @$columnarray);
if ($#out == -1) { $#out = 0; }
$out = $#out +1; # makes $#out of 0 = 1 so it gets counted !
push @distinctcounts, $out;
Thanks!
Jack