title: how can I scatter a small matrix in bigger matrix using python?
body: <p>I have a matrix with size 28x28 but for 49999 samples (it means <code>w_expand=np.zeros((49999,28,28),dtype='float32')</code>) I also have a smaller matrix with random values (<code>wt_random=np.random.randint(2, size=(49999,4,4))</code>) now, I want to divide the first matrix into 7x7 blocks and put each element of the second matrix in middle pixel of 7x7 blocks. if it was only one matrix I know what should I do, but for this example, I do not know how can I do this. could you please help me how can I do this with python. I also have another question. if I want to expand small matrix to large matrix what should I do? this means I divide the first matrix to 7x7 blocks and then all pixels of each 7x7 blocks have the value of each pixel of the smaller matrix. ( the first 7x7 block have the value of the first pixel of 4x4 matrix)I am not familiar with python more. Thanks.
  I used this loop, </p>
  
  <pre><code>w_expand=np.zeros((49999,28,28),dtype='float32')
  wv_expand=np.zeros((9999,28,28),dtype='float32')
  wt_random=np.random.randint(2, size=(49999,4,4))
  wt_random=wt_random.astype(np.float32)
  wv_random=np.random.randint(2, size=(9999,4,4))
  wv_random=wv_random.astype(np.float32)
  for i in range(4):
      for j in range(4):
          w_expand[:,(i)*7+3,(j)*7+3]=wt_random[:,i,j]
          wv_expand[:,(i)*7+3,(j)*7+3]=wv_random[:,i,j]
  </code></pre>
  
  <p>I think it works, right? can we do this without loop? but I could not solve my second problem about tiling one pixel of smaller matrix to part of bigger matrix</p>