title: load json from dict python
body: <p>I am trying to convert a dictionary object into json, but unable to do so. I tried json.load(), json.loads() but it gives me following error:</p>
  
  <pre><code>File "lean.py", line 252, in createJSON
  return json.loads(jsonElementDict)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
  return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
  obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  TypeError: expected string or buffer
  </code></pre>
  
  <p>When I print dictionary object, it's as follows:</p>
  
  <pre><code>{
  'city': 'Pittsburgh',
  'state': 'Pennsylvania',
  'gross_floor_area': '',
  'energyData': [
   {
    'cdd': '0.0', 
    'reading': '80.8', 
    'monthYear': 'Nov-2014'
   }, 
   {
    'cdd': '0.0',
    'reading': '300000.0', 
    'monthYear': 'Nov-2014'
   }
  ]
  }`
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>outputJSON = json.loads(jsonElementDict)
  print outputJSON.json['city']
  </code></pre>