moin Dimitar,
I don't use PDL::Char, but I think you ought to be able to do what you want
using qsortveci(); something like:
$p = pdl(byte, [map {[map {ord $_} @$_]}
[1,2,'c',3],[4,5,'a',6],[7,8,'b',9]]); # use a "vanilla" piddle ...
$keys = $p->slice("1:2,");
$p_sorted = $p->dice_axis(1, $keys->qsortveci);
... PDL::Char seems to behave a bit strangely here; but maybe this can get
you on your way...
marmosets,
Bryan
On Fri, May 30, 2014 at 9:20 AM, <[email protected]> wrote:
> hi guys,
> just a brief question about sorting a piddle.
>
> i have a piddle of this kind:
> $p=PDL::Char->new(@a=([1,2,'c',3],[4,5,'a',6],[7,8,'b',9]));
>
> And i would like to sort it by columns for example columns 2 and 3. But
> the only sorting i found in PDL was qsort and qsortvec but they dont do
> what i want. I searched the net but could not find any info on this matter.
>
> I was thinking to convert it to regular perl array so i can sort as i want
> but this is not very effective cos my actual piddle is large.
>
> Can you please help me in this matter? Any tips of info is appreciated
>
> Thank you
> Dimitar
>
>
>
> _______________________________________________
> Perldl mailing list
> [email protected]
> http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
>
--
Bryan Jurish "There is *always* one more bug."
[email protected] -Lubarsky's Law of Cybernetic Entomology
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl