kesterkester has asked for the wisdom of the Perl Monks concerning the following question:
Hi All--
It's clearly friday afternoon-- I can't figure out how to do a trivial set intersection in PDL.
I have:
use PDL; my $pdl_a = pdl 10..20; my $pdl_b = pdl 15..18; print "$pdl_a\n$pdl_b\n";
Producing this:
[10 11 12 13 14 15 16 17 18 19 20] [15 16 17 18]
I want:
use PDL; my $pdl_a = pdl 10..20; my $pdl_b = pdl 15..18; my $pdl_c = INTERSECTION OF PDL_A AND PDL_B print "$pdl_a\n$pdl_b\n$pdl_c\n";
Producing this:
[10 11 12 13 14 15 16 17 18 19 20] [15 16 17 18] [15 16 17 18]
What am I forgetting, O Monks?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple PDL question: set intersection
by kvale (Monsignor) on Oct 29, 2004 at 23:34 UTC | |
|
Re: Simple PDL question: set intersection
by etj (Priest) on Jun 22, 2022 at 20:10 UTC | |
|
Re: Simple PDL question: set intersection
by tall_man (Parson) on Nov 01, 2004 at 16:11 UTC |