title: Flatten nested JSON into pandas dataframe columns
body: <p>I have a pandas column with nested json data string. I'd like to flatten the data into multiple pandas columns. </p>
  
  <p>Here's data from a single cell: </p>
  
  <pre><code>rent['ques'][9] = "{'Rent': [{'Name': 'Asking', 'Value': 16.07, 'Unit': 'Usd'}], 'Vacancy': {'Name': 'Vacancy', 'Value': 25.34100001, 'Unit': 'Pct'}}"
  </code></pre>
  
  <p>For each cell in pandas column, I'd like parse this string and create multiple columns. Expected output looks something like this: </p>
  
  <p><a href="https://i.stack.imgur.com/rlIZb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rlIZb.png" alt="rent_vacancy"></a></p>
  
  <p>When I run, <code>json_normalize(rent['ques'])</code>, I receive the following error. </p>
  
  <pre><code> ---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-28-cebc86357f34&gt; in &lt;module&gt;()
  ----&gt; 1 json_normalize(rentoff['Survey'])
  
  /anaconda3/lib/python3.7/site-packages/pandas/io/json/normalize.py in json_normalize(data, record_path, meta, meta_prefix, record_prefix, errors, sep)
      196     if record_path is None:
      197         if any([[isinstance(x, dict)
  --&gt; 198                 for x in compat.itervalues(y)] for y in data]):
      199             # naive normalization, this is idempotent for flat records
      200             # and potentially will inflate the data considerably for
  
  /anaconda3/lib/python3.7/site-packages/pandas/io/json/normalize.py in &lt;listcomp&gt;(.0)
      196     if record_path is None:
      197         if any([[isinstance(x, dict)
  --&gt; 198                 for x in compat.itervalues(y)] for y in data]):
      199             # naive normalization, this is idempotent for flat records
      200             # and potentially will inflate the data considerably for
  
  /anaconda3/lib/python3.7/site-packages/pandas/compat/__init__.py in itervalues(obj, **kw)
      210 
      211     def itervalues(obj, **kw):
  --&gt; 212         return iter(obj.values(**kw))
      213 
      214     next = next
  
  AttributeError: 'str' object has no attribute 'values'
  </code></pre>