title: How to do linear interpolation for multi-dimensional arrays in Numpy?
body: <p>Having problems to implement a linear interpolation in <code>numpy</code> that works for n-D arrays. I would like a simple solution working for 1D and also 3D arrays.</p>
  <p>For the linear interpolation, I'm using <code>np.interp</code>, which works great for 1D:</p>
  <pre><code>x = [1, 2, 3, 4, 5]
  xp = [1, 3, 5]
  fp = [10, 30, 50]
  np.interp(x, xp, fp)
  Out: array([10., 20., 30., 40., 50.])
  </code></pre>
  <p>Now if my <code>fp</code> has multiple columns:</p>
  <pre><code>fp_multicol = np.array([10, 30, 50, 100, 300, 500]).reshape((2,3))
  Out: 
  array([[ 10,  30,  50],
         [100, 300, 500]])
  </code></pre>
  <p>That doesn't work directly with <code>np.interp</code> since it can only handle 1D arrays:</p>
  <pre><code>np.interp(x, xp, fp_multicol)
  Traceback (most recent call last):
  blablabla
  ValueError: object too deep for desired array
  </code></pre>
  <p>So I came up with a <code>for</code>-loop in a list comprehension:</p>
  <pre><code>np.array([np.interp(x, xp, col) for col in fp_multicol])
  array([[ 10.,  20.,  30.,  40.,  50.],
         [100., 200., 300., 400., 500.]])
  </code></pre>
  <p>But then that doesn't work for 1D arrays...</p>
  <pre><code>np.array([np.interp(x, xp, col) for col in fp])
  Traceback (most recent call last):
  blablabla
  ValueError: object of too small depth for desired array
  </code></pre>
  <p>Any quick and simple solution that would work for both?</p>
  <p>I'd expect <code>numpy</code> to have such interpolation function but so far could not find any.</p>