title: Flatten matrix in python :
body: <p>A trick when you want to flatten a matrix <code>X</code> of shape <code>(a,b,c,d)</code> to a matrix <code>X_flatten</code> of shape <code>(b ∗∗ c ∗∗ d, a)</code> is to use:</p>
  
  <pre><code>X_flatten = X.reshape(X.shape[0], -1).T    
  </code></pre>
  
  <p>I read this trick in coursera DL course, how does this work? Where did <code>-1</code> come from and what does it mean?</p>