title: Numpy flatten RGB image array
body: <p>I have 1,000 RGB images (64X64) which I want to convert to an (m, n) array. </p>
  
  <p>I use this:</p>
  
  <pre><code>import numpy as np
  from skdata.mnist.views import OfficialImageClassification
  from matplotlib import pyplot as plt
  from PIL import Image                                                            
  import glob
  import cv2
  
  x_data = np.array( [np.array(cv2.imread(imagePath[i])) for i in range(len(imagePath))] )
  print x_data.shape
  </code></pre>
  
  <p>Which gives me: <code>(1000, 64, 64, 3)</code></p>
  
  <p>Now if I do:</p>
  
  <pre><code>pixels = x_data.flatten()
  print pixels.shape
  </code></pre>
  
  <p>I get: <code>(12288000,)</code></p>
  
  <p>However, I require an array with these dimensions: <code>(1000, 12288)</code></p>
  
  <p>How can I achieve that?</p>