I have a multidimensional array
example =[[[1,1,2,2],[1,1,2,2]],[[1,1,3,3],[1,1,4,4]]]
for a simple call for an index a function used gives decent output
def calculate_sum(arr1,arr2):
s = arr1[0]+arr2[0]+arr1[1]+arr2[3]
return s
s = calculate_sum(example[1][0],example[1][1])
s
I can easily use for loop to iterate over example but want to know how to modify the function to vectorize over the array " example " to speed up the code
I have refered to similar threads but none deal with multidimensional arrays mapping properly