Yes, that is pretty much what I wanted.
Thanks.
On Sat, 5/27/17, Raul Miller wrote:
Subject: Re: [Jprogramming] Rename items of array
To: "Programming forum"
Date: Saturday, May 27, 2017, 5:56 PM
Like this?
arr=: ;:'a b
Like this?
arr=: ;:'a b a c b c a b b b c a b'
(;:'a b c')i.arr
0 1 0 2 1 2 0 1 1 1 2 0 1
((;:'a b c')i.arr){;:'e f g'
┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
│e│f│e│g│f│g│e│f│f│f│g│e│f│
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘
I hope this helps,
--
Raul
On Sat, May 27, 2017 at 4:43 AM, 'Jon Hough' via Progr
Let
a=: 'a'
b=: 'b'
c=: 'c'
and let
arr=: a;b;a;c;b;c;a;b;b;b;c;a;b NB. i.e. all items from a,b,c
I want to relabel the items
with
e=: 'e'
f=: 'f'
g=: 'g'
so a -> e, b -> f, c -> g.
so arr becomes
e;f;e;g;f;g;e;f;f;f;g;e;f
Is there a succinct (preferably tacit) way to do this?
I feel like