« first day (2324 days earlier)      last day (320 days later) » 

 
5 hours later…
5:59 PM
Remove nth index column from a matrix
rm ← {(((⍵-1)∘↑⍤1)⍺ ), (⍵∘↓⍤1)⍺ }
m1
┌→────┐
↓1 2 3│
│4 5 6│
└~────┘
m1 rm 2
┌→──┐
↓1 3│
│4 6│
└~──┘
Any idea hw to shorten my rm function?
 
@1234 (Btw, press ctrl+k before posting for proper formatting)
 
sorry..I just forget..
 
@1234 rm←{⍺[;⍵~⍨⍳≢⍉⍺]}
Btw, this works for removing multiple columns too.
@1234 rm←{⍺/⍨⍵≠⍳≢⍉⍺} is shorter but only works for removing a single column. Amend to rm←{⍺/⍨~⍵∊⍨⍳≢⍉⍺} for removal of any number of columns.
 
6:19 PM
nice
 
6:30 PM
should APL have a primitive function to remove column or row from matrix, or higher rank array?
It seems to me it is very common operation.
 
It already has: / and
 
Oh
this is why I'm here.. I have no idea what I'm doing.. :)
 
The left argument is a mask indicating which columns or rows, respectively, to keep.
 
cool.
 

« first day (2324 days earlier)      last day (320 days later) »