title: Why do the following codes take different times for execution (What is actually going on inside numpy arrays)?
body: <p>This is the one implemented using loops.</p>
  
  <pre><code>import cv2 as c
  import numpy as np
  img=c.imread("E:\\one.jpg")
  row,column,_=img.shape
  arr=np.zeros((row,column), dtype=np.int8)
  for i in range(0,row-1):
      for j in range(0,column-1):
          arr[i,j]=.114*img[i,j,0]+.587*img[i,j,1]+.299*img[i,j,2]
  c.imshow("one",arr)
  c.waitKey(0)
  c.destroyAllWindows()
  </code></pre>
  
  <p>This one using full array operation</p>
  
  <pre><code>import cv2 as c
  import numpy as np
  img=c.imread("E:\\one.jpg")
  row,column,_=img.shape
  arr=np.zeros((row,column), dtype=np.int8)
  img[:,:,0]=img[:,:,0]*.114
  img[:,:,1]=img[:,:,1]*.587
  img[:,:,2]=img[:,:,2]*.299
  arr=img[:,:,0]+img[:,:,1]+img[:,:,2]
  c.imshow("one",arr)
  c.waitKey(0)
  c.destroyAllWindows()
  </code></pre>
  
  <p>Why is the second one working faster compared to the first i.e. what makes the second one work more faster than the first?</p>
  
  <p>It will be very helpful if I get to know the logic used in implementing the full array operations.</p>