title: Function that guarantees a minimum number of dimensions (ndim) for a numpy.ndarray
body: <p>There are many situations where slicing operations in 2D arrays produce a 1D array as output, example:</p>
  
  <pre><code>a = np.random.random((3,3))
  # array([[ 0.4986962 ,  0.65777899,  0.16798398],
  #        [ 0.02767355,  0.49157946,  0.03178513],
  #        [ 0.60765513,  0.65030948,  0.14786596]])
  a[0,:]
  # array([ 0.4986962 ,  0.65777899,  0.16798398])
  </code></pre>
  
  <p>There are workarounds like:</p>
  
  <pre><code>a[0:1,:]
  # or
  a[0,:][np.newaxis,:]
  # array([[ 0.4986962 ,  0.65777899,  0.16798398]])
  </code></pre>
  
  <p>Is there any <code>numpy</code> built in function that transforms an input array to a given number of dimensions? Like:</p>
  
  <pre><code>np.minndim(a, ndim=2)
  </code></pre>