It sounds like maybe this is what you want?

(0&{"1 </. ]) tst
┌──────┬──────┬──────┐
│┌──┬─┐│┌──┬─┐│┌──┬─┐│
││10│1│││11│0│││12│1││
│├──┼─┤│├──┼─┤│├──┼─┤│
││10│1│││11│0│││12│0││
│├──┼─┤│├──┼─┤│├──┼─┤│
││10│1│││11│1│││12│0││
│├──┼─┤│├──┼─┤│├──┼─┤│
││10│0│││11│0│││12│0││
│├──┼─┤│├──┼─┤│├──┼─┤│
││10│1│││11│1│││12│1││
│├──┼─┤│└──┴─┘│├──┼─┤│
││10│1││      ││12│0││
│└──┴─┘│      │├──┼─┤│
│      │      ││12│0││
│      │      │├──┼─┤│
│      │      ││12│1││
│      │      │└──┴─┘│
└──────┴──────┴──────┘


or

   |: (~. (0&{"1) tst) ,: (0&{"1 <@;/. 1&{"1) tst
┌──┬───────────────┐
│10│1 1 1 0 1 1    │
├──┼───────────────┤
│11│0 0 1 0 1      │
├──┼───────────────┤
│12│1 0 0 0 1 0 0 1│
└──┴───────────────┘





On Tue, Apr 10, 2018 at 1:45 PM, 'Pascal Jasmin' via Programming <
programm...@jsoftware.com> wrote:

> if I understand correctly, there are 2 levels of boxing (or data can be
> made into 2 level) such as
>
> <"1 <"0 ? 3 10 $ 2
>
> then, this will unbox the inner set without introducing fills.
>
> ; each <"1 <"0 ? 3 10 $ 2
>
>
>
>
> ________________________________
> From: Skip Cave <s...@caveconsulting.com>
> To: "programm...@jsoftware.com" <programm...@jsoftware.com>
> Sent: Tuesday, April 10, 2018 1:32 PM
> Subject: Re: [Jprogramming] Indvidual unboxing
>
>
>
> ​​
> I probably need to back up a step:
>
> My original data looks something like this:
>
> t=: 4 : '(y#x),.?y#2'
>
> ]tst=: > each(10 t 6),"2 (11 t 5), 12 t 8
>
> ┌──┬─┐
>
> │10│0│
>
> ├──┼─┤
>
> │10│1│
>
> ├──┼─┤
>
> │10│1│
>
> ├──┼─┤
>
> │10│1│
>
> ├──┼─┤
>
> │10│1│
>
> ├──┼─┤
>
> │10│0│
>
> ├──┼─┤
>
> │11│0│
>
> ├──┼─┤
>
> │11│1│
>
> ├──┼─┤
>
> │11│0│
>
> ├──┼─┤
>
> │11│0│
>
> ├──┼─┤
>
> │11│0│
>
> ├──┼─┤
>
> │12│0│
>
> ├──┼─┤
>
> │12│1│
>
> ├──┼─┤
>
> │12│0│
>
> ├──┼─┤
>
> │12│1│
>
> ├──┼─┤
>
> │12│1│
>
> ├──┼─┤
>
> │12│1│
>
> ├──┼─┤
>
> │12│0│
>
> ├──┼─┤
>
> │12│0│
>
> └──┴─┘
>
>
> I want to box the boolean second column using the first column for an
> index:
>
>
> f1 tst
>
> ┌──┬───────────────┐
>
> │10│1 1 1 1 0 1 │
>
> ├──┼───────────────┤
>
> │11│0 1 0 0 0 │
>
> ├──┼───────────────┤
>
> │12│0 1 0 1 1 1 0 0│
>
> └──┴───────────────┘
>
>
> Or maybe this is better if it get rid if the fills.
>
>
> f2 tst
>
> ┌──┬───────────┬──┬─────────┬──┬───────────────┐
>
> │10│1 1 1 1 0 1│11│0 1 0 0 0│12│0 1 0 1 1 1 0 0│
>
> └──┴───────────┴──┴─────────┴──┴───────────────┘
>
> However, I need to find a boolean string givem it's index: 11 fb f2 tst
>
>
> ┌─────────┐
>
> │0 1 0 0 0│
>
> └─────────┘
>
> Skip
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to