title: Pandas - Column expansion of List of Dictionary - How to Optimise?
body: <p>I have a dataframe <code>test</code> with 3 columns <code>id, name, value</code> the following column <code>test['values']</code>. A sample of how <code>test</code> looks is:</p>
  
  <pre><code>    name                  values
  0   impressions           [{'value': 17686, 'end_time': '2018-06-12T07:0...
  1   reach                 [{'value': 6294, 'end_time': '2018-06-12T07:00...
  2   follower_count        [{'value': 130, 'end_time': '2018-06-12T07:00:...
  3   email_contacts        [{'value': 1, 'end_time': '2018-06-12T07:00:00...
  4   phone_call_clicks     [{'value': 0, 'end_time': '2018-06-12T07:00:00...
  5   text_message_clicks   [{'value': 0, 'end_time': '2018-06-12T07:00:00...
  6   get_directions_clicks [{'value': 0, 'end_time': '2018-06
  </code></pre>
  
  <p>The test value cells look something like this:</p>
  
  <pre><code>[{'end_time': '2018-06-12T07:00:00+0000', 'value': 17686},
   {'end_time': '2018-06-13T07:00:00+0000', 'value': 4064}]
  </code></pre>
  
  <p>I can expand it by doing the following:</p>
  
  <pre><code>test[['Values 1', 'Values 2']] = test['values'].apply(pd.Series)
  test[['Date 1', 'Values 1']] = test['Values 1'].apply(pd.Series)
  test[['Date 2', 'Values 2']] = test['Values 2'].apply(pd.Series)
  test.drop(['values'], axis=1, inplace=True)
  </code></pre>
  
  <p>The result is something like this:</p>
  
  <pre><code>id                          name        Values 1    Values 2    Date 1  Date 2
  /insights/impressions/day   impressions 17686   4064    2018-06-12T07:00:00+0000    2018-06-13T07:00:00+0000
  /insights/reach/day reach   6294    2085    2018-06-12T07:00:00+0000    2018-06-13T07:00:00+0000
  /insights/follower_count/day    follower_count  130 37  2018-06-12T07:00:00+0000    2018-06-13T07:00:00+0000
  </code></pre>
  
  <p>I was wondering if:</p>
  
  <p><strong>a.</strong> There's a faster way to expand the list of dictionaries</p>
  
  <p><strong>b.</strong> There's a way to unpivot the data so that values 1 and values 2 are on one column. And Date 1 and Date 2 are in another column</p>