I have a table
t: flip `S`V ! ((`$"|A|B|"; `$"|B|C|D|"; `$"|B|"); 1 2 3)
and some dicts
t1: 4 10 15 20 ! 1 2 3 5;
t2: 4 10 15 20 ! 0.5 2 4 5;
Now I need to add a column with values on the the substrings in S and the function below (which is a bit pseudocode because I am stuck here).
f:{[s;v];
if[`A in "|" vs string s; t:t1;];
else if[`B in "|" vs string s; t:t2;];
k: asc key t;
:t k k binr v;
}
problems are that s and v are passed in as full column vectors when I do something like
update l:f[S,V] from t;
How can I make this an operation that works by row? How can I make this a vectorized function? Thanks
k: asc key t;:t k k binr v;
(although tricky with binr)v:4 5 10 13 20 21;t:`s#reverse neg[4 10 15 20]! 1 2 3 5 //neg as binr;t neg v 1 2 2 3 5 0N
– Euphonium