code: def __xd_iterator_pass_on(arr, view, fun):
      
      # create list of iterations
      iterations = [[None] if dim in view else list(range(arr.shape[dim])) for dim in range(arr.ndim)]
       
      # iterate, create slicer, execute function and collect results
      passon = None
      for indices in itertools.product(*iterations):
          slicer = [slice(None) if idx is None else slice(idx, idx + 1) for idx in indices]
          passon = fun(scipy.squeeze(arr[slicer]), passon)
          
      return passon
docs: Like xd_iterator, but the fun return values are always passed on to the next and only the last returned.