title: Python TypeError: unhashable type: 'dict'
body: <p>I am attempting to use an API request to gather weather data and ultimately save the data to a CSV file with pandas.to_csv. The API request is working, but I get this error when I am trying to convert the API response from a dictionary to pandas. Any tips for what I am doing wrong is greatly appreciated:</p>
  
  <p>TypeError: unhashable type: 'dict'</p>
  
  <p>The last line in the code is what is messed up and the shell is returning an error:</p>
  
  <pre><code>from urllib.request import urlopen
  import json
  import pandas as pd
  
  api_key = ""
  date = "20170601"
  zip_code = "53711"
  
  response = urlopen("http://api.wunderground.com/api/%s/history_%s/q/%s.json"     % (api_key, date, zip_code))
  
  json_data = response.read().decode('utf-8', 'replace')
  
  data = json.loads(json_data)
  
  for observation in data['history']['observations']:
       print("Date/Time:    " + observation['date']['pretty'])
       print("Temperature:  " + observation['tempi'])
       print("Humidity:     " + observation['hum'])
  
  df = pd.DataFrame([data], columns=data.keys())
  </code></pre>
  
  <p>The screen shot is what the data looks like in the shell output:
  <a href="https://i.stack.imgur.com/OHigB.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OHigB.jpg" alt="enter image description here"></a></p>