Or simpler when you want everything except specified rows:
delitems=: ({~ <^:3)~
a=: 1 3 delitems i. 5 2
0 1
4 5
8 9
see "Complementary Indexing" in
https://code.jsoftware.com/wiki/Vocabulary/curlylf#dyadic
Best regards,
Jan-Pieter
On Tue, May 19, 2020, 14:27 'Pascal Jasmin' via Programming <
[email protected]> wrote:
> To go from indexes to mask
>
> delitems =: (] #~ [ 0:`[`]} 1 #~ #@])
>
> 1 2 delitems i. 7 2
>
> 0 1
>
> 6 7
>
> 8 9
>
> 10 11
>
> 12 13
>
>
>
>
>
>
>
> On Tuesday, May 19, 2020, 07:56:08 a.m. EDT, HH PackRat <
> [email protected]> wrote:
>
>
>
>
>
> On 5/19/20, Michael Dykman <[email protected]> wrote:
> > In functional languages, you don't really delete so much as you make a
> > fresh copy absent of the undesirable elements.
> > Where you looking for this?
> >
> > ] a=. <"0 'abcdef'
> > ┌─┬─┬─┬─┬─┬─┐
> > │a│b│c│d│e│f│
> > └─┴─┴─┴─┴─┴─┘
> > 0 0 1 1 0 1 # a
> > ┌─┬─┬─┐
> > │c│d│f│
> > └─┴─┴─┘
>
> That kind of thing is what gave me the idea of a boolean mask of some
> type. However, can this be carried over, applying to rows of a table
> instead? I'm thinking that it probably does in some way, but I want
> confirmation on that. Thanks for your response!
>
>
> Harvey
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm