You should be able to search using the pdldoc
command or the help or apropos commands in
the PDL shells:
pdl> apropos unique
uniq return all unique elements of a piddle
uniqind Return the indices of all unique elements of a piddle
The order is in the order of the values to be consistent
with uniq. `NaN' values never compare equal with any
other value and so are always unique. This follows the
Matlab usage.
uniqvec Return all unique vectors out of a collection
On Tue, Sep 18, 2012 at 11:33 PM, dpath2o <[email protected]> wrote:
> Hi,
>
> I'm wondering if anyone may have insight on determining the indices of
> unique pairs, triplets, quadruplets, etc.
>
> Consider:
> $x = pdl[1,5,8,9,12,20,18,16,16,13, 2,1,5,7,13,15]
> $y = pdl[0,2,1,7, 2, 6, 9, 4, 9,20,20,0,8,7,20, 5]
> $o = pdl[$x,$y]
> $i = $o->uniqind
>
> My desire is to have $i = [0 1 2 3 4 5 6 7 8 9 10 12 13 15]; noting that 11
> and 14 are absent because they're repeats.
> The obvious solution is to sum and then determine unique sums (i.e. $s =
> $x+$y; $i = $s->uniqind), but this seems a little careless, and does not
> work on ND matrices. Further it does not allow for further diagnostics,
> like the frequency or number of occurrences of pairs, triplets, etc.
>
> Does anyone have a more robust solution or is there interest in enhancing
> the functionality of 'uniq' (and its kin) to obtain results on, at the very
> least, 2D and possibly ND matrices?
>
> Cheers,
> Dan
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl