[Jprogramming] rank trouble
Graham Parkhouse
graham.parkhouse at ntlworld.com
Sat Jun 2 04:54:51 HKT 2012
------------
Thank you Devon and Alexander! -. does intersection most elegantly. I shall
use it.
On Fri, 1 Jun 2012 12:50:43 -0400 Devon McCormick <devonmcc at gmail.com>
wrote:
> You could also do this:
>
> e ([:~.]-.]-.[) pi
> 3 1 2
> pi ([:~.]-.]-.[) e
> 2 1 3
>
> Without the "nub" gives an arguably more correct answer:
>
> pi (]-.]-.[) e
> 2 1 2 1 3
> e (]-.]-.[) pi
> 3 1 1 2
>
> /:~"1 e,:pi
> 1 1 2 2 3 7 8 8 8
> 1 1 2 3 4 5 5 6 9
>
>
> On Thu, May 31, 2012 at 10:48 AM, Graham Parkhouse
> <graham.parkhouse at ntlworld.com> wrote:
> > Can anyone help me to understand where I am going wrong?
> >
> > ? e=: 2 7 1 8 2 8 1 8 3
> > ? pi=: 3 1 4 1 5 9 2 6 5
> > ? isecn=: ([: /:~ [: ~. e. # [)"1 ? ? NB. Intersection of the two
> sets
> > ? e isecn pi
> > 1 2 3
> > ? pi isecn e
> > 1 2 3
> > ? isecn/ e,:pi
> > 1 2 3
> > ? isecn/"1 e,.pi
> >
> >
> >
> >
> >
> >
> >
> >
> > This last sentence give me 9 blank lines. I expected and wanted 1 2
> 3. Is my
> > view of rank and frames too simplistic?
> >
> > Regards
> >
> > Graham
> >
> > ---------------------------------------------------------------------
> -
> > For information about J forums see
> http://www.jsoftware.com/forums.htm
>
>
>
> --
> Devon McCormick, CFA
> ^me^ at acm.
> org is my
> preferred e-mail
On Fri, 1 Jun 2012 10:35:26 -0700 (PDT) Alexander Mikhailov
<avmich at yahoo.com> wrote:
> Without the "nub" gives an arguably more correct answer:
>
> pi (]-.]-.[) e
> 2 1 2 1 3
> e (]-.]-.[) pi
> 3 1 1 2
> -----
>
> Why not
>
> e ([ -. -.) pi
> 2 1 2 1 3
> ?
Regards
Graham
----------------
More information about the Programming
mailing list