title: Pandas apply in parallel when axis=0
body: <p>I want to apply some function on all pandas columns in parallel. For example, I want to do this in parallel:</p>
  
  <pre><code>def my_sum(x, a):
      return x + a
  
  
  df = pd.DataFrame({'num_legs': [2, 4, 8, 0],
                     'num_wings': [2, 0, 0, 0]})
  df.apply(lambda x: my_sum(x, 2), axis=0)
  </code></pre>
  
  <p>I know there is a <code>swifter</code> package, but it doesn't support <code>axis=0</code> in apply: </p>
  
  <blockquote>
    <p>NotImplementedError: Swifter cannot perform axis=0 applies on large
    datasets. Dask currently does not have an axis=0 apply implemented.
    More details at <a href="https://github.com/jmcarpenter2/swifter/issues/10" rel="noreferrer">https://github.com/jmcarpenter2/swifter/issues/10</a></p>
  </blockquote>
  
  <p>Dask also doesn't support this for <code>axis=0</code> (according to documentation in swifter).</p>
  
  <p>I have googled several sources but couldn't find an easy solution.</p>
  
  <p>Can't believe this is so complicated in pandas.</p>