I should have provided some explanation of the version I offered.

The first part executed - the rightmost part - generalizes the Boolean
expansion vector Henry had hard-coded in his examples:

   (0) 2}1$~>:{:$table
> 1 1 0 1


This is handy because it helps generalize the defined verb to work in
expected ways: inserting before column 0 inserts a new initial column and
inserting before "column 4" inserts a new final column.  It wouldn't be
hard to further generalize this to insert multiple columns.

On Mon, Jul 20, 2015 at 8:46 AM, Strale <[email protected]> wrote:

> Hi Henry
>
> Quite hard for a beginner like me
> but the one with complex number looks easier to read and remember
>
> Thanks
> Paolo
>
> On Mon, Jul 20, 2015 at 2:35 PM, Henry Rich <[email protected]> wrote:
>
> > These work.  All are ugly but I don't know of a better way.
> >
> >    column (,2)}"1 (1 1 0 1) #^:_1"1 table
> >
> >    column (<a:;,2)} (1 1 0 1) #^:_1"1 table
> >
> >    column (,2)}"1 (1 1j1 1) #"1 table
> >
> >    column (<a:;,2)} 1 1 2 #"1 table
> >
> > Henry Rich
> >
> >
> > On 7/20/2015 8:11 AM, Strale wrote:
> >
> >> Hello
> >>
> >> I am trying to combine Tables togethers
> >>
> >> for example I would like to insert column before the column 2 of the
> table
> >>
> >>     [table =. 3 3 $  <"0 i.9
> >>
> >> ┌─┬─┬─┐
> >>
> >> │0│1│2│
> >>
> >> ├─┼─┼─┤
> >>
> >> │3│4│5│
> >>
> >> ├─┼─┼─┤
> >>
> >> │6│7│8│
> >>
> >> └─┴─┴─┘
> >>
> >>
> >>     [column =. 3 1$ (<,'0')
> >>
> >> ┌─┐
> >>
> >> │0│
> >>
> >> ├─┤
> >>
> >> │0│
> >>
> >> ├─┤
> >>
> >> │0│
> >>
> >> └─┘
> >>
> >>
> >>
> >> the solution I have found at the moment is the following:
> >>
> >>
> >>     [tab2 =. 2|."1  table
> >>
> >> ┌─┬─┬─┐
> >>
> >> │2│0│1│
> >>
> >> ├─┼─┼─┤
> >>
> >> │5│3│4│
> >>
> >> ├─┼─┼─┤
> >>
> >> │8│6│7│
> >>
> >> └─┴─┴─┘
> >>
> >>
> >>     [tab3 =. column ,"1 1    tab2
> >>
> >> ┌─┬─┬─┬─┐
> >>
> >> │0│2│0│1│
> >>
> >> ├─┼─┼─┼─┤
> >>
> >> │0│5│3│4│
> >>
> >> ├─┼─┼─┼─┤
> >>
> >> │0│8│6│7│
> >>
> >> └─┴─┴─┴─┘
> >>
> >>
> >> Result:
> >>
> >>     2|."1 tab3
> >>
> >> ┌─┬─┬─┬─┐
> >>
> >> │0│1│0│2│
> >>
> >> ├─┼─┼─┼─┤
> >>
> >> │3│4│0│5│
> >>
> >> ├─┼─┼─┼─┤
> >>
> >> │6│7│0│8│
> >>
> >> └─┴─┴─┴─┘
> >>
> >>
> >> Can you suggest me a better solution ?
> >>
> >> Thanks
> >>
> >> Paolo
> >> ----------------------------------------------------------------------
> >> For information about J forums see http://www.jsoftware.com/forums.htm
> >>
> >>  ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
>
>
>
>
> --
> We are made of star dust
> (Carl Sagan)
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to