def _update_result(self, result, insertions, dimension_index):
        """Insert subtotals into resulting ndarray."""
        for j, (ind_insertion, value) in enumerate(insertions):
            result = np.insert(
                result, ind_insertion + j + 1, value, axis=dimension_index
            )
        return result
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
Insert subtotals into resulting ndarray.