title: numpy ravel versus flat in slice assignment
body: <p>According to the documentation, <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.flat.html" rel="nofollow"><code>ndarray.flat</code></a> is an iterator over the array while <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.ravel.html" rel="nofollow"><code>ndarray.ravel</code></a> returns a flattened array (when possible). So my question is, when should we use one or the other?
  Which one would be preferred as the rvalue in an assignment like the one in the code below?</p>
  
  <pre><code>import numpy as np
  
  x = np.arange(2).reshape((2,1,1))
  y = np.arange(3).reshape((1,3,1))
  z = np.arange(5).reshape((1,1,5))
  
  mask = np.random.choice([True, False], size=(2,3,5))
  # netCDF4 module wants this kind of boolean indexing:
  nc4slice = tuple(mask.any(axis=axis) for axis in ((1,2),(2,0),(0,1)))
  indices = np.ix_(*nc4slice)
  
  ncrds = 3
  npnts = (np.broadcast(*indices)).size
  points = np.empty((npnts, ncrds))
  for i,crd in enumerate(np.broadcast_arrays(x,y,z)):
      # Should we use ndarray.flat ...
      points[:,i] = crd[indices].flat
      # ... or ndarray.ravel():
      points[:,i] = crd[indices].ravel()
  </code></pre>