code: def _update_result(self, result, insertions, dimension_index):
          
          for j, (ind_insertion, value) in enumerate(insertions):
              result = np.insert(
                  result, ind_insertion + j + 1, value, axis=dimension_index
              )
          return result
docs: Insert subtotals into resulting ndarray.