in reply to Simple PDL question: set intersection
printsuse PDL; my $arr = pdl 10..20;; print $arr, "\n"; my $idx = which( $arr>14 & $arr<19 ); print $idx, "\n"; my $subset = $arr->index( $idx); print $subset, "\n";
If you need real set intersection and not just subranges, converting to hashes may be the easiest apporach.[10 11 12 13 14 15 16 17 18 19 20] [5 6 7 8] [15 16 17 18]
-Mark
|
|---|