title: dictionary inside of a pandas dataframe
body: <p>I have a list of dictionaries which looks like this:</p>
  <pre><code>response = [{'startIndex': 0,
    'destinationIndex': 0,
    'summary': {'travelTime': 2797, 'costFactor': 2884}},
   {'startIndex': 0,
    'destinationIndex': 1,
    'summary': {'travelTime': 3686, 'costFactor': 4541}},
   {'startIndex': 0,
    'destinationIndex': 2,
    'summary': {'travelTime': 3391, 'costFactor': 3979}},
   {'startIndex': 0,
    'destinationIndex': 3,
    'summary': {'travelTime': 3082, 'costFactor': 3244}},
   {'startIndex': 1,
    'destinationIndex': 0,
    'summary': {'travelTime': 0, 'costFactor': 1}},
   {'startIndex': 1,
    'destinationIndex': 1,
    'summary': {'travelTime': 1103, 'costFactor': 2656}},
   {'startIndex': 1,
    'destinationIndex': 2,
    'summary': {'travelTime': 808, 'costFactor': 2094}},
   {'startIndex': 1,
    'destinationIndex': 3,
    'summary': {'travelTime': 676, 'costFactor': 1595}},
   {'startIndex': 2,
    'destinationIndex': 0,
    'summary': {'travelTime': 1543, 'costFactor': 3152}},
   {'startIndex': 2,
    'destinationIndex': 1,
    'summary': {'travelTime': 0, 'costFactor': 1}},
   {'startIndex': 2,
    'destinationIndex': 2,
    'summary': {'travelTime': 1496, 'costFactor': 3043}},
   {'startIndex': 2,
    'destinationIndex': 3,
    'summary': {'travelTime': 1489, 'costFactor': 3106}},
   {'startIndex': 3,
    'destinationIndex': 0,
    'summary': {'travelTime': 1208, 'costFactor': 2484}},
   {'startIndex': 3,
    'destinationIndex': 1,
    'summary': {'travelTime': 1377, 'costFactor': 2807}},
   {'startIndex': 3,
    'destinationIndex': 2,
    'summary': {'travelTime': 0, 'costFactor': 1}},
   {'startIndex': 3,
    'destinationIndex': 3,
    'summary': {'travelTime': 624, 'costFactor': 1378}}]
  </code></pre>
  <p>As you may see, one of the keys of the dictionaries (<code>summary</code>) is also a dictionary. What I want to do is to pass all dictionaries into a pandas dataframe. I am trying to use the following code to do that:</p>
  <pre><code>new_df = pd.DataFrame.from_dict(response, orient = 'columns')
  </code></pre>
  <p>However I am getting this output:</p>
  <pre><code>startIndex  destinationIndex                                   summary
  0                 0           {'travelTime': 2966, 'costFactor': 3053}
  0                 1           {'travelTime': 3868, 'costFactor': 4723}
  0                 2           {'travelTime': 3573, 'costFactor': 4161}
  0                 3           {'travelTime': 3164, 'costFactor': 3326}
  1                 0           {'travelTime': 0, 'costFactor': 1}
  1                 1           {'travelTime': 1114, 'costFactor': 2667}
  1                 2            {'travelTime': 819, 'costFactor': 2105}
  1                 3            {'travelTime': 676, 'costFactor': 1595}
  2                 0           {'travelTime': 1543, 'costFactor': 3152}
  2                 1                 {'travelTime': 0, 'costFactor': 1}
  2                 2           {'travelTime': 1496, 'costFactor': 3043}
  2                 3           {'travelTime': 1489, 'costFactor': 3106}
  3                 0           {'travelTime': 1208, 'costFactor': 2484}
  3                 1           {'travelTime': 1377, 'costFactor': 2807}
  3                 2                 {'travelTime': 0, 'costFactor': 1}
  3                 3            {'travelTime': 624, 'costFactor': 1378}
  </code></pre>
  <p>My first two columns are ok but in my third column I have a dictionary where <code>travelTime</code> and <code>costFactor</code> are the keys. What I want to do is to &quot;create&quot; new columns with those keys so my final df should look like this:</p>
  <p><a href="https://i.stack.imgur.com/pfsTA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pfsTA.png" alt="enter image description here" /></a></p>
  <p>If anyone has any idea about how to do that I would really appreciate your help!</p>