[Jprogramming] Deleting?
'Pascal Jasmin' via Programming
programming at jsoftware.com
Tue May 19 12:26:22 UTC 2020
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 <hhpackrat at gmail.com> wrote:
On 5/19/20, Michael Dykman <mdykman at gmail.com> 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
More information about the Programming
mailing list