import numpy as np
from numpy.random import random
c1 = random((10, 10, 10, 10))
c2 = random((10, 10, 10, 10))
c3 = np.zeros_like(c2)
Sum 4D array efficiently according to indices contained in another array