Thanks! I was not aware of the padding vs. replicating behavior, but I
guess it is due to the possibility of pdl accepting non-ndarray
arguments.
Regards,
Luis
On Thu, Aug 21, 2025 at 11:36:29AM +, Jörg Sommrey wrote:
> The "pdl" constructor does not replicate values to match dimensions but
The "pdl" constructor does not replicate values to match dimensions
but pads them instead. In contrary, "cat" works as expected:
pdl> do_print 1
1
pdl> $v = sequence 2
[0 1]
pdl> cat $v(,*1), $v(*1,)
[
[
[0 1]
[0 1]
]
[
[0 0]
[1 1]
]
]
Best regards,
-jo
On Tue 19 Aug 2025 07:0
I'm confused by variations of the following program:
use v5.36;
use PDL;
use PDL::NiceSlice;
my $v=sequence(2);
my $m=pdl($v->slice(":,*2"), $v->slice("*2,:"));
say $m;
The output is
[
[
[0 1]
[0 1]
]
[
[0 0]
[1 1]
]
]
which is what I expected. But after