title: Apply function slow in dataframe
body: <p>I have a dataframe that looks like this:</p>
  
  <pre><code>&gt;&gt; df      
    A
  0 [{k1:v1, k2:v2}, {k1:v3, k2:v4}]
  1 [{k1:v5, k2:v6}, {k1:v7, k2:v8}, {k1:v9, k2:v10}]
  </code></pre>
  
  <p>that is column A is a list of dicts with same keys</p>
  
  <p>and I want to extract the values corresponding to the first dict in those lists:</p>
  
  <pre><code>  K1 K2 A
  0 v1 v2 ...
  1 v5 v6 ...
  </code></pre>
  
  <p>my solution so far works but is particularly slow (> 1min for ~50K records):</p>
  
  <pre><code>def extract_first_dict(s):
      s['K1'] = s['A'][0]['k1']
      s['K2'] = s['A'][0]['k2']
      return s
  df = df.apply(extract_first_dict, axis = 1)
  </code></pre>
  
  <p>Anybody could suggest a better, faster way to do this?
   Thanks!</p>