title: How can I create columns out of a nested dictionary in python pandas
body: <p>I'm trying to filter my data frame by making separate columns to increase readability and usability. </p>
  
  <p>Problem statement: 
  Column "Editables" has a nested dictionary as the value I'm trying to create separate columns as per the key. For instance 'photo_repace' 'text_remove', 'text_add' has different columns.</p>
  
  <p>The nested dictionary: </p>
  
  <pre><code>{
  'photo': {
      'photo_replace': None,
      'photo_remove': None,
      'photo_add': None,
      'photo_effect': None,
      'photo_brightness': None,
      'background_color': None,
      'photo_resize': None,
      'photo_rotate': None,
      'photo_mirror': None,
      'photo_layer_rearrange': None,
      'photo_move': None
  },
  'text': {
      'text_remove': None,
      'text_add': None,
      'text_edit': None,
      'font_select': None,
      'text_color': None,
      'text_style': None,
      'background_color': None,
      'text_align': None,
      'text_resize': None,
      'text_rotate': None,
      'text_move': None,
      'text_layer_rearrange': None
  }
  }
  
  </code></pre>
  
  <p><strong>Output</strong> </p>
  
  <p><a href="https://i.stack.imgur.com/S1sAd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S1sAd.png" alt="enter image description here"></a>
  </p>
  
  <p>Code I've been using: </p>
  
  <pre><code>df["editables"] = df["editables"].apply(lambda x : dict(eval(x)))
  df_edit = df["editables"].apply(pd.Series )
  </code></pre>
  
  <p>Output: 
  <a href="https://i.stack.imgur.com/L1n7A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L1n7A.png" alt="enter image description here"></a></p>