title: Python multiprocessing for expensive operation with 2D array
body: <p>I have a function, say <code>fun(a,b)</code> that is quite expensive, and returns a set of data.</p>
  
  <p>My current method looks like:</p>
  
  <pre><code>a = np.linspace(0,100,300)
  b = np.linspace(0,100,300)
  A,B = np.meshgrid(a,b)
  Y = np.zeros(A.shape)
  
  for i,av in enumerate(a):
    for j, bv in enumerate(b):
      Y[i,j] = fun(av,bv)
  </code></pre>
  
  <p>(Sort of, I had to muddle things a bit to make it fit). Anyway, the process takes quite a long time, and I was wondering if there was a straightforward way to use my multicore processor to speed things up. </p>