The documentationhttp://code.kx.com/wiki/Reference/iascGives the following exampleq)L:2 1 3 4 2 1 2q)iasc L1 5 0 4 6 2 3Why does the “0” correspond to the value “3”? Shouldn’t 0 correspondto the lowest value i.e. one of the “1” values?
iasc is returning a permutation index.
you might be thinking of an inverse permutation index.
/ L@pi
q)L:2 1 3 4 2 1 2
q)iasc L
1 5 0 4 6 2 3
q)L iasc L
1 1 2 2 2 3 4
/ L[ipi]:L
q)iasc iasc L
2 0 5 6 3 1 4
q)L[iasc iasc L]:L
q)L
1 1 2 2 2 3 4
Thanks Charles it makes sense now. So the “0” is actually referring tothe first “2” in the original listOn Nov 5, 7:33?am, Charles Skelton <char…> wrote:> iasc is returning a permutation index.>> you might be thinking of an inverse permutation index.>> / L@pi> q)L:2 1 3 4 2 1 2> q)iasc L> 1 5 0 4 6 2 3> q)L iasc L> 1 1 2 2 2 3 4>> / L[ipi]:L> q)iasc iasc L> 2 0 5 6 3 1 4> q)L[iasc iasc L]:L> q)L> 1 1 2 2 2 3 4>> On Sat, Nov 5, 2011 at 7:11 AM, Sean Larsen <sean.larse…> wrote:> > The documentation>> >http://code.kx.com/wiki/Reference/iasc>> > Gives the following example>> > q)L:2 1 3 4 2 1 2> > q)iasc L> > 1 5 0 4 6 2 3>> > Why does the “0” correspond to the value “3”? ?Shouldn’t 0 correspond> > to the lowest value i.e. one of the “1” values?>> > –> >
Submitted via Google Groups</sean.larse…></char…>