Why are for-loops much slower than broadcasting
Why are for-loops much slower than broadcasting Question: Comparing two chunks of code for a simple matrix operation, the one with a nested for loop is much slower. I wonder: what is the underlying reason for this? This loop tuns for 2.5 seconds: m = np.zeros((800,8000)) for i in range(0,800): for j in range(0,8000): m[i,j] …