Here's Raul's answer. How do you get the same results with your strategy?
Linda
A=:'1809';'Philip St. George Cooke';'1895'
B=:'1836';'Flora Cooke Stuart';'1923'
C=:'1833';'Jeb Stuart';'1864'
D=:'1834';'Jacob Sharpe';'189'
[E=:A,B,C,:D
┌────┬───────────────────────┬────┐
│1809│Philip St. George Cooke│1895│
├────┼───────────────────────┼────┤
│1836│Flora Cooke Stuart │1923│
├────┼───────────────────────┼────┤
│1833│Jeb Stuart │1864│
├────┼───────────────────────┼────┤
│1834│Jacob Sharpe │189 │
└────┴───────────────────────┴────┘
rm=: [ /: <:@] {"1 [
E rm 1
┌────┬───────────────────────┬────┐
│1809│Philip St. George Cooke│1895│
├────┼───────────────────────┼────┤
│1833│Jeb Stuart │1864│
├────┼───────────────────────┼────┤
│1834│Jacob Sharpe │189 │
├────┼───────────────────────┼────┤
│1836│Flora Cooke Stuart │1923│
└────┴───────────────────────┴────┘
E rm 3
┌────┬───────────────────────┬────┐
│1833│Jeb Stuart │1864│
├────┼───────────────────────┼────┤
│1834│Jacob Sharpe │189 │
├────┼───────────────────────┼────┤
│1809│Philip St. George Cooke│1895│
├────┼───────────────────────┼────┤
│1836│Flora Cooke Stuart │1923│
└────┴───────────────────────┴────┘
-----Original Message-----
From: Linda A Alvord [mailto:[email protected]]
Sent: Monday, June 27, 2016 7:24 PM
To: '[email protected]'
Subject: RE: [Jprogramming] Rearranging rows of tables
Pascal. This works for the first situation. How do you rearrange the rows based
on the third colum of data? Linda
-----Original Message-----
From: Programming [mailto:[email protected]] On Behalf
Of 'Pascal Jasmin' via Programming
Sent: Sunday, June 26, 2016 9:28 PM
To: [email protected]
Subject: Re: [Jprogramming] Rearranging rows of tables
can also work with "tie break" columns. A bit more natural with 0 based
columns:
3 3 $ 2 5 2 2 1 4 5 6 7
2 5 2
2 1 4
5 6 7
0 1 ({"1 /:~ ]) 3 3 $ 2 5 2 2 1 4 5 6 7
2 1 4
2 5 2
5 6 7
----- Original Message -----
From: Henry Rich <[email protected]>
To: [email protected]
Sent: Sunday, June 26, 2016 8:59 PM
Subject: Re: [Jprogramming] Rearranging rows of tables
f =: [ /: {"1~
untested.
Henry Rich
On 6/26/2016 8:50 PM, Linda A Alvord wrote:
> Design a function f, so D f 3 will arrange the rows in order from
> small to large values in column 3 andD f 1 will do the same for column 1.
>
>
>
>
>
> A=:(<30),(<'CAT'),<11
>
> B=:(<18),(<'GOAT'),<10
>
> C=:(<27),(<'BAT'),<9
>
> [D=:A,B,:C
>
> ---T----T--┐
>
> │30│CAT │11│
>
> +--+----+--+
>
> │18│GOAT│10│
>
> +--+----+--+
>
> │27│BAT │9 │
>
> L--+----+---
>
>
>
> If you prefer 3 f D and 1 f D, that's OK. Thanks, Linda
>
> ----------------------------------------------------------------------
> 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
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm