This operation, which I call converting from a binary operation table, to a tuple representation, was common because each representation had distinct advantages, and conversion between them was essential... in my experience anyways. That being said, I'm not sure where the }. of the top row would come from.
------------------------------------------------------------------------ |\/| Randy A MacDonald | APL: If you can say it, it's done.. (ram) |/\| [EMAIL PROTECTED] | |\ | | The only real problem with APL is that BSc(Math) UNBF'83 | it is "still ahead of its time." Sapere Aude | - Morten Kromberg Natural Born APL'er | Demo website: http://156.34.82.188/ -----------------------------------------------------(INTP)----{ gnat }- ----- Original Message ----- From: "Chris Burke" <[EMAIL PROTECTED]> To: "Programming forum" <[email protected]> Sent: Wednesday, February 07, 2007 10:43 PM Subject: Re: [Jprogramming] reshaping array > 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
