Handy
On Tue, Oct 6, 2015 at 6:15 PM, Kip Murray wrote:
> This is what I wanted to send. --Kip Murray
>
> NB. A way to do column operations
>
> NB. rop below makes row 2 become cumulative total of row 1
>
> rop =: (2 {. ]),([: +/\ 1 { ]), 3 }. ]
>
> NB. cop below makes col 2 become cumulative to
This is what I wanted to send. --Kip Murray
NB. A way to do column operations
NB. rop below makes row 2 become cumulative total of row 1
rop =: (2 {. ]),([: +/\ 1 { ]), 3 }. ]
NB. cop below makes col 2 become cumulative total of col 1
cop =: rop&.|:
NB. Example
]sheet =: i. 5 4
0 1 2 3
4 5 6
Apologies for the mess below -- ill-behaving mailer! --Kip Murray
On Tue, Oct 6, 2015 at 6:05 PM Kip Murray wrote:
>NB. A
> way to do column operations
> NB. rop
> below makes row 2 become cumulative total of row 1
> rop =:
> (2 {. ]),([: +/\ 1 { ]), 3 }. ]
> NB. cop
> below make
NB. A
way to do column operations
NB. rop
below makes row 2 become cumulative total of row 1
rop =:
(2 {. ]),([: +/\ 1 { ]), 3 }. ]
NB. cop
below makes col 2 become cumulative total of col 1
cop =:
rop&.|: NB.
Example
]sheet
=: i. 5 4 0 1 2
3 4 5 6
7 8 9 10
1112 1
Not at all. I often transpose but in this case the table has less than 1000
rows so it's not a large amount of data.
Sent from my iPhone
> On Oct 6, 2015, at 5:14 PM, Raul Miller wrote:
>
> Rather than using a rank 1 operation, I'd prefer to use a
> column-at-a-time approach (in other words:
Rather than using a rank 1 operation, I'd prefer to use a
column-at-a-time approach (in other words: transpose the table before
working on it).
I think that performance should be better, and the expressions are
easier (in my opinion) to create.
Ndx=: 3 :0"0
{. y&{::`''
)
ColNdxs=: 3 :0
#('`'
The other day I was converting spreadsheet formulas that applied between
columns to J operations on numeric tables.
One such formula was:
((I - E) + R) - D
Where the verbs -,+ work on columns. To convert this to a simple J
expression you can "Iversonize".
D -~ R + E -~ I
which leads directly t