Hi Ed,
I got a message that I could not send to the list because the server was
not responding for some time, or something like that.
Hmm, I thought I saw in the docs something like clump (1 ... -1), which
isn't there right now.
So I must have applied wishful thinking and use negative index in the
slice syntax way (1:-1) to (1..-1). It would still be nice, though. ;-)
Sorry to bother you
Ingo
On 28.05.24 6:34 PM, Ed . wrote:
Hi Ingo,
I’m getting bounces from pdl-devel the last couple of days, and the
archive isn’t showing new messages including yours, but I did receive
your message via pdl-devel, so I don’t know what’s going on.
To answer your point: which bits of the docs explicitly says
clump(1..-1) should work? Because that’s a Perl expression that will
make an empty list, since -1 is a number that’s lower than 1, which is
why you’re getting an error.
The second error you’re showing is because dimensions are numbered in
a zero-based way, so ndims (which is 14) will be the 15^th one, which
is too big, as the error explicitly tells you.
Best regards,
Ed
------------------------------------------------------------------------
*From:* Ingo Schmid via pdl-devel <pdl-devel@lists.sourceforge.net>
*Sent:* Tuesday, May 28, 2024 7:26:59 AM
*To:* pdl-devel <pdl-devel@lists.sourceforge.net>
*Subject:* Re: [Pdl-devel] clump glitch
could not send mail.
On 27.05.24 5:27 PM, Ingo Schmid wrote:
Hi,
$x->clump (1 .. -1) should work according to the docs, but it
apparently doesn't. boundaries 0 ... ndims -1 work fine.
pdl> help $k2
This variable is Float D [2,772096,1,1,1,1,30,1,1,1,1,1]
pdl> $k2= $k->clump(2 .. ($k->ndims-1))
Best
Ingo
pdl> help $k2
This variable is Float D [2,1,23162880] -C 0.00KB
pdl> $k2= $k->clump(2 .. (-1))
Runtime error: Usage: PDL::_clump_int(PARENT,CHILD,n) (you may leave
output variables out of list) at (eval 692) line 5.
pdl> $k2= $k->clump(2 .. ($k->ndims))
Runtime error: dimension index 14 larger than greatest dimension at
/ceph/mri.meduniwien.ac.at/departments/physics/metabolism/lab/cardiac_31P/perlbrew/perls/perl-5.36.0/lib/site_perl/5.36.0/x86_64-linux/PDL/Core.pm
line 1587.
PDL::clump(MRI::ReadData=HASH(0x559ebeffb570), 2, 3, 4, 5, 6, 7,
8, ...) called at (eval 693) line 5
_______________________________________________
pdl-devel mailing list
pdl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pdl-devel