mple:
> > > >
> > > >'-' 3 ins 'hello'
> > > > hel-lo
> > > >
> > > > It also does:
> > > > column 2 ins"1 table
> > > > --T-T-T-┐
> > > > │0│1│0│2│
> > > > +-+-+-+-+
> >
-+-+-+
> > > │3│4│0│5│
> > > +-+-+-+-+
> > > │6│7│0│8│
> > > L-+-+-+--
> > >
> > > Ben
> > >
> > >
> > >
> > > From: programming-boun...@forums.jsoft
Alvord
Sent: Monday, July 20, 2015 4:23 PM
To: programm...@jsonceftware.com
Subject: Re: [Jprogramming] insert column into tables
It doesn't have to be hard! You are progressingj well. Here's where you are so
far. Take pme ste[ at a to,e frm right to left an it will make good sense
t=.i.3 3
0 3 1 2{"1 t,.10 11 12
0 10 1 2
3 11 4 5
6 12 7 8
--
For information about J forums see http://www.jsoftware.com/forums.htm
> │0│1│0│2│
> ├─┼─┼─┼─┤
> │3│4│0│5│
> ├─┼─┼─┼─┤
> │6│7│0│8│
> └─┴─┴─┴─┘
>
> Linda
>
> -Original Message-
> From: programming-boun...@forums.jsoftware.com [mailto:
> programming-boun...@forums.jsoftware.com] On Behalf Of Kip Murray
> Sent: Monday, July 20, 201
─┴─┴─┴─┘
Linda
-Original Message-
From: programming-boun...@forums.jsoftware.com
[mailto:programming-boun...@forums.jsoftware.com] On Behalf Of Kip Murray
Sent: Monday, July 20, 2015 9:18 AM
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] insert column into tables
Following
jsoftware.com [mailto:programming-
> boun...@forums.jsoftware.com] On Behalf Of R.E. Boss
> Sent: maandag 20 juli 2015 18:19
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] insert column into tables
>
> I would prefer
>
>'-' 3 (1 :(':';'(x,y)
Hi Paolo,
Some answers to your question included the idiom (&.|:). This idiom is
very useful when working with tables (matrices). Why? Because, given the
design of J, often operations in terms of rows, as opposed to columns, are
easier to write and (&.|:) allows to port quickly a solution for r
te - CITG
> Sent: maandag 20 juli 2015 14:55
> To: programm...@jsoftware.com
> Subject: Re: [Jprogramming] insert column into tables
>
> From a discussion a while ago I kept the following:
>
> NB. insert new items into an array - behaves like amend.
> ins =: 1 : (':'
Message -
From: Ben Gorte - CITG
To: "programm...@jsoftware.com"
Cc:
Sent: Monday, July 20, 2015 8:54 AM
Subject: Re: [Jprogramming] insert column into tables
From a discussion a while ago I kept the following:
NB. insert new items into an array - behaves like amend.
ins =: 1 : (':
Following up on Raul's "use transpose" idea:
tbl
0 1 2
3 4 5
6 7 8
insertcol =: 1 : '({. , m , }.)&.|:'
2 (0 0 0 insertcol) tbl
0 1 0 2
3 4 0 5
6 7 0 8
--Kip Murray
On Monday, July 20, 2015, Raul Miller wrote:
> The classic "insertion" method for J is to use {. for the part before
> t
When this happens it's often worth spending a few minutes looking them
up and trying some simple examples so you can see how they work for
the kind of data you're working with.
Thanks,
--
Raul
On Mon, Jul 20, 2015 at 8:54 AM, Strale wrote:
> Hi Dan
>
>
> this is getting me really scared :)
>
The classic "insertion" method for J is to use {. for the part before
the insertion and }. for the part after the insertion.
An example of this might be:
table =: 3 3 $ <"0 i.9
column =: 3 1$ (<,'0')
column ((2{."1]),.[,.2}."1]) table
But it also might be simpler to use transpose:
co
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
┬─┐
│0│1│0│2│
├─┼─┼─┼─┤
│3│4│0│5│
├─┼─┼─┼─┤
│6│7│0│8│
└─┴─┴─┴─┘
Ben
From: programming-boun...@forums.jsoftware.com
[programming-boun...@forums.jsoftware.com] on behalf of Strale
[str...@gmail.com]
Sent: Monday, July 20, 2015 14:11
To: programm...@jso
Hi Dan
this is getting me really scared :)
there are even symbols I do not know
Thanks
On Mon, Jul 20, 2015 at 2:46 PM, Strale 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, 201
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 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
Slightly generalized from Henry's examples - the ugly can be hidden under a
cover:
insertColBefore=: 4 : '(>0{y) (,>1{y)}"1 x#^:_1"1~(0) (>1{y)}1$~>:{:$x'
>table insertColBefore column;2
> +-+-+-+-+
> |0|1|0|2|
> +-+-+-+-+
> |3|4|0|5|
> +-+-+-+-+
> |6|7|0|8|
> +-+-+-+-+
On Mon, Jul 20, 2
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 (
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│
├─┼─┼─┤
│
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 ha
20 matches
Mail list logo