There is a verb resamp in https://code.jsoftware.com/wiki/Phrases/Arith.
--
For information about J forums see http://www.jsoftware.com/forums.htm
Thanks Elijah, Mike, and Pascal!
Elijah: I'd forgotten the idiom of putting one's default value at the end
of an array and using it as the "not found" value, so that's good to have
reinforced, thank you. Your insight about the data's origins and your last
solution hit the nail on the head, and tha
I have a kv library, I published before. It includes (kvinsert) an ordered
insert function to permit arbitrary order, but its design and testing may need
improvement. In this case, it seems that appending then sorting represents the
order that you want. In kv library append also updates when
Elijah's reply offers lots of ideas, with thoughts about filling histogram
results.
However, this might also be of interest:
xs NB. a small example
1 2 4 6 7
4 6 3 8 5
expand NB. I think this is included in J at startup
#^:_1
expxs =: {{ix,:y expand~x e.~ix=. >:i. {:x}}/
expxs xs
1