Why is this a common operation? Anyway:

   a=. 100+i.4
   b=. 21+i.5
   c=. i.4 5
   (>,{a;b),.,c
100 21  0
100 22  1
100 23  2
100 24  3
...

Sherlock, Ric wrote:
> Is there a built in mechanism for doing the following common operation?
> 
> How would I go about reshaping the following data from this
> 
>    ]tst=.(<'id') (<0;0)}(;/20+i.6),((;/100+i.4),.<"0 i.4 5)
> +---+--+--+--+--+--+
> |id |21|22|23|24|25|
> +---+--+--+--+--+--+
> |100|0 |1 |2 |3 |4 |
> +---+--+--+--+--+--+
> |101|5 |6 |7 |8 |9 |
> +---+--+--+--+--+--+
> |102|10|11|12|13|14|
> +---+--+--+--+--+--+
> |103|15|16|17|18|19|
> +---+--+--+--+--+--+
>    
> To this?
> 
> +---+---+---+
> |id |cat|val|
> +---+---+---+
> |100| 21|  0|
> +---+---+---+
> |100| 22|  1|

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to