title: How to apply a function in parallel to multiple images in a numpy array?
body: <p>Let's say I have an <code>images</code> array that holds 100,000 images with 3 channels.</p>
  
  <pre><code>images = np.random.randint(0,255,(100000,32,32,3))
  </code></pre>
  
  <p>And I have a function <code>foo</code> which accepts an image and performs some operation on it.</p>
  
  <pre><code>def foo(img):
      #some operation on the image, say histogram equalization
  </code></pre>
  
  <p>How do I now apply the <code>foo</code> function to 100000 images in parallel? I thought numpy would have some function for this purpose, but I was disappointed to not find any. I found <code>numpy.apply_along_axis</code> but I read it is rather iterative. What should I do?</p>