def func(input):
pass
a = np.random.randint(0,10,size=(1000,1000,5,6))
for i in range(1000):
for j in range(1000):
a[i][j]=func(a[i][j])
The loops waste too much time. Is there a way to implement loops through numpy's own functions?