Fun challenge - opted to go for a solution where I scaffold-ed out cases that were 0 and generated the surrounding frame. Joined and averaged. Also see others opted for a spatial solution finding the 8 nearest grids that is probably a better way of getting to the answer but i wanted to find a non-spatial solution