nickschurch has asked for the wisdom of the Perl Monks concerning the following question:
What I want to do is search within the larger piddle for values that match any of those in the second piddle, and return their index values. So in this case I'd end up with a piddle that looks like [3,6,8].my $a = sequence(10); print $a; [0,1,2,3,4,5,6,7,8,9] my $b = pdl(2,5,7); print $b; [2,5,7]
Butmy $z = which($a==$b(1)); print $z; [3]
fails completely. Any ideas?my $z = which($a==$b);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl PDL question
by Anonymous Monk on Nov 27, 2007 at 10:47 UTC | |
by Anonymous Monk on Nov 27, 2007 at 11:34 UTC | |
by nickschurch (Acolyte) on Nov 28, 2007 at 01:53 UTC | |
by nickschurch (Acolyte) on Nov 28, 2007 at 02:39 UTC | |
by Anonymous Monk on Nov 28, 2007 at 07:53 UTC | |
by nickschurch (Acolyte) on Nov 29, 2007 at 04:22 UTC |