Transpose | |: _ 1 _ | Transpose |
|: reverses the order of the axes of its argument. For example:(] ; |:) i. 3 4 +---------+------+ |0 1 2 3|0 4 8| |4 5 6 7|1 5 9| |8 9 10 11|2 6 10| | |3 7 11| +---------+------+ |
x|:y moves axes x to the tail end. If x is
boxed, the axes in each box are run together to produce
a single axis:y=: 3 4$'abcdefghijkl' y;(1 0|:y);(0|:y);((<0 1)|:y) +----+---+---+---+ |abcd|aei|aei|afk| |efgh|bfj|bfj| | |ijkl|cgk|cgk| | | |dhl|dhl| | +----+---+---+---+ |
y=: a.{~ (a. i. 'a') + i. 2 3 4 z=: y;(2 1 |: y);((<2 1) |: y);(|: i. 4 5) z ,&< |:&.> z +------------------------+-------------------------+ |+----+---+---+---------+|+--+--+--+--------------+| ||abcd|aei|afk|0 5 10 15|||am|am|am| 0 1 2 3 4|| ||efgh|bfj|mrw|1 6 11 16|||eq|bn|fr| 5 6 7 8 9|| ||ijkl|cgk| |2 7 12 17|||iu|co|kw|10 11 12 13 14|| || |dhl| |3 8 13 18||| |dp| |15 16 17 18 19|| ||mnop| | |4 9 14 19|||bn| | | || ||qrst|mqu| | |||fr|eq| | || ||uvwx|nrv| | |||jv|fr| | || || |osw| | ||| |gs| | || || |ptx| | |||co|ht| | || |+----+---+---+---------+||gs| | | || | ||kw|iu| | || | || |jv| | || | ||dp|kw| | || | ||ht|lx| | || | ||lx| | | || | |+--+--+--+--------------+| +------------------------+-------------------------+