Stevem

I think using just ".&> would work better for you than using cut,
because cut reverses the order of each row. Also, notice that ravel is
just as good as raze.

   a   NB. this is your a
+-+-+-+-+-+
|1|2|3|4|5|
+-+-+-+-+-+
   ".&> a
1 2 3 4 5
   $".&> a
1 5
   ,".&> a
1 2 3 4 5
   $,".&> a
5



On Fri, Feb 13, 2009 at 4:21 AM, Steven Taylor <[email protected]> wrote:
> I thought I should post a quick example based on the help received
> load 'csv'
> '1,2,3,4,5' fwrite 'l4.csv'
> a=: readcsv jpath 'l4.csv'
> $ a
> 1 5
>    NB. from right to left: cut into atoms ;.0     unbox >     convert (".)
>    raise (i.e. reduce shape from 1 5 to 5);
> ] b=:;(".)&>;.0 a
> 5 4 3 2 1
> $ b
> 5
> +/ b
> 15

-- 
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to