title: How to return an array of at least 4D: efficient method to simulate numpy.atleast_4d
body: <p>numpy provides three handy routines to turn an array into at least a 1D, 2D, or 3D array, e.g. through <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.atleast_3d.html#numpy.atleast_3d" rel="nofollow noreferrer">numpy.atleast_3d</a></p>
  <p>I need the equivalent for one more dimension: <code>atleast_4d</code>. I can think of various ways using nested if statements but I was wondering whether there is a more efficient and faster method of returning the array in question. In you answer, I would be interested to see an estimate (O(n)) of the speed of execution if you can.</p>