title: A better way to do this triple loop using numpy methods
body: <p>So I'm just trying to write a simple script to convert RBG to YUV and I have ended up with something like this:</p>
  
  <pre><code>rgb2yuv_matrix = np.array([[0.299, 0.587, 0.114], [-0.1473, -0.28886, 0.436],[0.615, -0.51499, 0.10001]])
  for i in range(n_train):
      for j in range(32):
          for k in range(32):
              # Note here that X_train[i, j, k] is a 3 element array
              X_train[i,j,k] = np.dot(rgb2yuv_matrix, X_train[i,j,k])
  </code></pre>
  
  <p>I was wondering if there is a better way to do this since I know a triple loop is very inefficient, but I don't know if there is a better way to do it in numpy.</p>