Hello,
I started teaching about PDL to some students. The first step is building PDL.
When I install PDL in my account in my old laptop, everything runs
smoothly, but in order to be illustrative I made a new account for
myself and built it there under a perlbrew installation. It was nice
that the
Ok, Ed,
That example did not work for me.
The conditional results seems to be allways false. I mean, that it give $x
also when $x is near to 0.5 than 0.2, where I is expecting the $x**2 result.
Regates
El El lun, 20 ene 2025 a la(s) 20:39, Ed . escribió:
> Hi Guillermo,
>
> You may still be h
Hi Guillermo,
You may still be having a problem, but you have yet to tell us what it is. The
code you sent works fine, including as many dimensions as you like (because all
acts on the whole ndarray at once).
If there's a problem in there, please share it :-)
Best regards,
Ed
Thanks Ed,
Using ternary conditional expression
I still have some problem with múltiple disensión case.
See my example in message befare
El El lun, 20 ene 2025 a la(s) 19:31, Ed . escribió:
> Hi Guillermo,
>
> You can do that indeed, that's just Perl. If you wanted to do operations
> on a subse
Hi Guillermo,
You can do that indeed, that's just Perl. If you wanted to do operations on a
subset of that ndarray, then you'd do e.g.
$pdl->where(($pdl-0.5)->abs < 0.2) *= 5;
An observation is that the above condition could be a bit shorter by using the
recently-added approx_artol: (which wou
Hello !
I am not sure, but maybe It is possible to do with perl PDL something
like this?
$ndarray= condition on $ndarray ? assign when true : assign when false
for example:
$x=zeroes(20)->xlinvals(0,1);
$y=(all abs($x-0.5)<0.2)?$x**2:$x;
Thanks in advance
Regards
--
Dr. Guillermo P. Orti