in reply to Hash-type lookup in PDL

Here are a couple of other ideas for you.
#!/usr/bin/perl use warnings; use strict; use PDL; my $x = sequence(5); print "$x \n"; my $lookup = { 0 => 101, 1 => 69, 2 => 42, 3 => 10042, 4 => 99 }; my $y = zeroes(5); foreach (keys %{$lookup}){ set $y, ,$_ ,$lookup->{$_}; } print "$y \n";

This one is probably more useful, because you can read in a large amount of data.

#!/usr/bin/perl use warnings; use strict; use PDL; use PDL::IO::Misc; my $z = rcols *DATA; print "$z\n"; print $z->at(1); print "\n"; __DATA__ 101 69 42 10042 99

I'm not really a human, but I play one on earth. Cogito ergo sum a bum