Chris - thank you again, looks good. Henry - I started there but got stuck (should've mentioned it). I skimmed though it and was trying to apply pi to the problem, which clearly didn't work. It looks like oc is what I needed. Upon a re-read, "oc" or "occurrence count" is exactly what I'm looking for
oc (1,2,1,1,2) 0 0 1 2 1 On Wed, Mar 28, 2018 at 3:22 PM, Henry Rich <[email protected]> wrote: > See also > > http://code.jsoftware.com/wiki/Essays/Progressive_Index-Of > > Henry Rich > > > On 3/28/2018 3:14 PM, chris burke wrote: >> >> Following up your good start: >> >> a ,: <: +/ (* +/\"1) = a=: 1 2 1 1 2 3 2 3 >> >> 1 2 1 1 2 3 2 3 >> >> 0 0 1 2 1 0 2 1 >> >> a ,: <: +/ (* +/\"1) = a=: 5 6 5 5 6 5 7 6 >> >> 5 6 5 5 6 5 7 6 >> >> 0 0 1 2 1 3 0 2 >> >> >> On Wed, Mar 28, 2018 at 11:32 AM, Joe Bogner <[email protected]> wrote: >> >>> I think this is an easy one but it's escaping me. How to calculate a >>> running count of an item in a list? >>> >>> runct (1,2,1,1,2) -: 0,0,1,2,1 >>> runct (5,6,5,5,6) -: 0,0,1,2,1 >>> >>> This seems to be a good start >>> >>> = (5,6,5,5,6) >>> 1 0 1 1 0 >>> 0 1 0 0 1 >>> ---------------------------------------------------------------------- >>> For information about J forums see http://www.jsoftware.com/forums.htm >> >> ---------------------------------------------------------------------- >> For information about J forums see http://www.jsoftware.com/forums.htm > > > > --- > This email has been checked for viruses by AVG. > http://www.avg.com > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
