|
From: | Louis de Forcrand |
Subject: | Re: [Bug-apl] Help with APL expression |
Date: | Wed, 5 Jul 2017 12:48:44 +0200 |
Is it important that they be grouped in the order specified by the key? If not, this should do (with C the categories and S the strings): (⊂[1]C∘.=∪C)/¨⊂S If they must be ordered, then this can do it: (⊂[1]C∘.=U[⍋U←∪C])/¨⊂S In addition, the categories don’t have to be numbers. Note that Dyalog’s (dyadic) key function is equivalent to this, with L being the operator’s left operand: L¨(⊂[1]C∘.=∪C)/¨⊂S Cheers, Louis
|
[Prev in Thread] | Current Thread | [Next in Thread] |