Chris had contributed a series of articles to vector to introduce J for APLers, including axis and amend. a: means taking all elements for that axis. In particular a:{table is table.

They should be available in jwiki.

Sherlock, Ric wrote:
Thanks to you all for the helpful answers and also to Devon for the
explanations. Chris' response had me stumped for a while until I realised that it was
pretty much the equivalent of APLs table[;1]


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Chris Burke
Sent: Wednesday, 7 February 2007 18:44
To: Programming forum
Subject: Re: [Jprogramming] Amending columns

Sherlock, Ric wrote:
Am new to J (from APL) and am having trouble with selective assignment
.
I understand that in J the equivalent is to use Amend. Given:
   ]table=.4 2$ ;:'taa tas ewe wtw tweqewqwq 4212 fgsaera jihjy'
   ]newcol=. ;:'mean to been formed'
   ]newrow=. ;:'thra rowskd'

Lets say I want to replace the 2nd column of table with a new column.
The following works: newcol (0 1;1 1;2 1;3 1)}table

But this doesn't:
   newcol 1}"1 table
|rank error
|   newcol     1}"1 table

Also:

   newcol (<a:;1)} table
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm



--
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to