the common way is {. i. 1 3 5
$ {. i. 1 3 5
3 5
a trick to remove all 1s
$ (, $~ 1 -.~ $) i. 1 3 1 5
3 5
----- Original Message -----
From: Jon Hough <[email protected]>
To: [email protected]
Cc:
Sent: Friday, July 18, 2014 12:12:40 AM
Subject: [Jprogramming] Discarding unneeded dimensions
If I have an array of shape 1 3 6, for example, but I want to discard the 1, to
give shape 3 6, what is the best way to do so?
I found that doing ,/ on the array works.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm