In [1]:
import requests
graded = 6/7
In [2]:
response = requests.get('https://api.forecast.io/forecast/a69e446312b60b9982fba351359a544f/22.3964,114.1095')
In [3]:
print(response.text)
data = response.json()
{"latitude":22.3964,"longitude":114.1095,"timezone":"Asia/Hong_Kong","offset":8,"currently":{"time":1466214023,"summary":"Clear","icon":"clear-day","precipIntensity":0.0066,"precipProbability":0.28,"precipType":"rain","temperature":84.21,"apparentTemperature":95.54,"dewPoint":78.26,"humidity":0.82,"windSpeed":9.93,"windBearing":193,"visibility":6.21,"cloudCover":0.21,"pressure":1010.45,"ozone":276.46},"hourly":{"summary":"Drizzle until this afternoon.","icon":"rain","data":[{"time":1466211600,"summary":"Drizzle","icon":"rain","precipIntensity":0.0069,"precipProbability":0.3,"precipType":"rain","temperature":83.72,"apparentTemperature":94.67,"dewPoint":78.32,"humidity":0.84,"windSpeed":9.42,"windBearing":193,"visibility":6.21,"cloudCover":0.2,"pressure":1010.36,"ozone":276.45},{"time":1466215200,"summary":"Drizzle","icon":"rain","precipIntensity":0.0064,"precipProbability":0.27,"precipType":"rain","temperature":84.45,"apparentTemperature":95.95,"dewPoint":78.23,"humidity":0.82,"windSpeed":10.18,"windBearing":192,"visibility":6.21,"cloudCover":0.22,"pressure":1010.49,"ozone":276.47},{"time":1466218800,"summary":"Drizzle","icon":"rain","precipIntensity":0.006,"precipProbability":0.25,"precipType":"rain","temperature":85.31,"apparentTemperature":97.65,"dewPoint":78.36,"humidity":0.8,"windSpeed":10.9,"windBearing":191,"visibility":6.21,"cloudCover":0.27,"pressure":1010.51,"ozone":276.53},{"time":1466222400,"summary":"Drizzle","icon":"rain","precipIntensity":0.0059,"precipProbability":0.24,"precipType":"rain","temperature":86.56,"apparentTemperature":100.73,"dewPoint":79.05,"humidity":0.78,"windSpeed":11.6,"windBearing":189,"visibility":6.21,"cloudCover":0.36,"pressure":1010.39,"ozone":276.69},{"time":1466226000,"summary":"Drizzle","icon":"rain","precipIntensity":0.0058,"precipProbability":0.24,"precipType":"rain","temperature":88.15,"apparentTemperature":105.13,"dewPoint":80.2,"humidity":0.77,"windSpeed":12.26,"windBearing":187,"visibility":6.21,"cloudCover":0.49,"pressure":1010.16,"ozone":276.89},{"time":1466229600,"summary":"Drizzle","icon":"rain","precipIntensity":0.0055,"precipProbability":0.22,"precipType":"rain","temperature":89.23,"apparentTemperature":108.5,"dewPoint":81.13,"humidity":0.77,"windSpeed":12.59,"windBearing":185,"visibility":6.21,"cloudCover":0.64,"pressure":1009.96,"ozone":277.03},{"time":1466233200,"summary":"Drizzle","icon":"rain","precipIntensity":0.0051,"precipProbability":0.2,"precipType":"rain","temperature":88.44,"apparentTemperature":106.31,"dewPoint":80.62,"humidity":0.78,"windSpeed":12.5,"windBearing":183,"cloudCover":0.97,"pressure":1009.83,"ozone":277.09},{"time":1466236800,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","precipIntensity":0.0044,"precipProbability":0.16,"precipType":"rain","temperature":87.11,"apparentTemperature":102.81,"dewPoint":79.84,"humidity":0.79,"windSpeed":12.1,"windBearing":181,"cloudCover":0.93,"pressure":1009.74,"ozone":277.08},{"time":1466240400,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","precipIntensity":0.0037,"precipProbability":0.13,"precipType":"rain","temperature":85.65,"apparentTemperature":99.17,"dewPoint":79.08,"humidity":0.81,"windSpeed":11.42,"windBearing":178,"cloudCover":0.9,"pressure":1009.71,"ozone":277.02},{"time":1466244000,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","precipIntensity":0.0031,"precipProbability":0.1,"precipType":"rain","temperature":84.2,"apparentTemperature":95.84,"dewPoint":78.55,"humidity":0.83,"windSpeed":10.36,"windBearing":174,"cloudCover":0.86,"pressure":1009.77,"ozone":276.79},{"time":1466247600,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","precipIntensity":0.0024,"precipProbability":0.07,"precipType":"rain","temperature":82.85,"apparentTemperature":92.87,"dewPoint":78.19,"humidity":0.86,"windSpeed":9.12,"windBearing":168,"cloudCover":0.82,"pressure":1009.89,"ozone":276.49},{"time":1466251200,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0.0019,"precipProbability":0.04,"precipType":"rain","temperature":81.88,"apparentTemperature":90.86,"dewPoint":77.96,"humidity":0.88,"windSpeed":8.22,"windBearing":162,"cloudCover":0.79,"pressure":1010.12,"ozone":276.45},{"time":1466254800,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0.0014,"precipProbability":0.03,"precipType":"rain","temperature":81.39,"apparentTemperature":89.82,"dewPoint":77.8,"humidity":0.89,"windSpeed":7.85,"windBearing":156,"cloudCover":0.8,"pressure":1010.57,"ozone":276.89},{"time":1466258400,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0.0008,"precipProbability":0.01,"precipType":"rain","temperature":81.19,"apparentTemperature":89.38,"dewPoint":77.73,"humidity":0.89,"windSpeed":7.74,"windBearing":151,"cloudCover":0.83,"pressure":1011.05,"ozone":277.58},{"time":1466262000,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":81.06,"apparentTemperature":89.15,"dewPoint":77.73,"humidity":0.9,"windSpeed":7.61,"windBearing":149,"cloudCover":0.85,"pressure":1011.35,"ozone":278.15},{"time":1466265600,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":80.94,"apparentTemperature":88.97,"dewPoint":77.78,"humidity":0.9,"windSpeed":7.31,"windBearing":150,"cloudCover":0.86,"pressure":1011.38,"ozone":278.43},{"time":1466269200,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":80.79,"apparentTemperature":88.68,"dewPoint":77.76,"humidity":0.91,"windSpeed":6.96,"windBearing":153,"cloudCover":0.86,"pressure":1011.29,"ozone":278.6},{"time":1466272800,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":80.51,"apparentTemperature":87.96,"dewPoint":77.56,"humidity":0.91,"windSpeed":6.72,"windBearing":154,"cloudCover":0.85,"pressure":1011.16,"ozone":278.75},{"time":1466276400,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":79.98,"apparentTemperature":79.98,"dewPoint":77.11,"humidity":0.91,"windSpeed":6.59,"windBearing":150,"cloudCover":0.85,"pressure":1010.99,"ozone":278.94},{"time":1466280000,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":79.42,"apparentTemperature":79.42,"dewPoint":76.58,"humidity":0.91,"windSpeed":6.63,"windBearing":144,"cloudCover":0.84,"pressure":1010.75,"ozone":279.13},{"time":1466283600,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":79.98,"apparentTemperature":79.98,"dewPoint":76.9,"humidity":0.9,"windSpeed":6.89,"windBearing":139,"cloudCover":0.82,"pressure":1010.64,"ozone":279.21},{"time":1466287200,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":80.99,"apparentTemperature":88.58,"dewPoint":77.29,"humidity":0.89,"windSpeed":7.45,"windBearing":137,"cloudCover":0.78,"pressure":1010.83,"ozone":279.13},{"time":1466290800,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":82.08,"apparentTemperature":90.69,"dewPoint":77.46,"humidity":0.86,"windSpeed":8.17,"windBearing":138,"cloudCover":0.72,"pressure":1011.16,"ozone":278.94},{"time":1466294400,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":82.96,"apparentTemperature":92.22,"dewPoint":77.32,"humidity":0.83,"windSpeed":8.63,"windBearing":138,"cloudCover":0.64,"pressure":1011.38,"ozone":278.71},{"time":1466298000,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":83.82,"apparentTemperature":93.5,"dewPoint":76.97,"humidity":0.8,"windSpeed":8.59,"windBearing":140,"cloudCover":0.52,"pressure":1011.44,"ozone":278.39},{"time":1466301600,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":85.01,"apparentTemperature":95.33,"dewPoint":76.78,"humidity":0.77,"windSpeed":8.31,"windBearing":142,"cloudCover":0.37,"pressure":1011.41,"ozone":278.03},{"time":1466305200,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":86.5,"apparentTemperature":98.06,"dewPoint":77.06,"humidity":0.74,"windSpeed":8.12,"windBearing":144,"cloudCover":0.27,"pressure":1011.27,"ozone":277.81},{"time":1466308800,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":88.21,"apparentTemperature":101.8,"dewPoint":77.91,"humidity":0.72,"windSpeed":8.13,"windBearing":148,"cloudCover":0.26,"pressure":1010.95,"ozone":277.9},{"time":1466312400,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":89.81,"apparentTemperature":105.76,"dewPoint":78.95,"humidity":0.71,"windSpeed":8.22,"windBearing":151,"cloudCover":0.3,"pressure":1010.5,"ozone":278.14},{"time":1466316000,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":90.7,"apparentTemperature":108.34,"dewPoint":79.71,"humidity":0.7,"windSpeed":8.28,"windBearing":152,"cloudCover":0.35,"pressure":1010.02,"ozone":278.23},{"time":1466319600,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":90.27,"apparentTemperature":107.63,"dewPoint":79.67,"humidity":0.71,"windSpeed":8.29,"windBearing":149,"cloudCover":0.41,"pressure":1009.52,"ozone":278.05},{"time":1466323200,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":89.38,"apparentTemperature":106.05,"dewPoint":79.54,"humidity":0.73,"windSpeed":8.31,"windBearing":143,"cloudCover":0.49,"pressure":1009.03,"ozone":277.72},{"time":1466326800,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":88.2,"apparentTemperature":103.95,"dewPoint":79.4,"humidity":0.75,"windSpeed":8.29,"windBearing":138,"cloudCover":0.55,"pressure":1008.73,"ozone":277.36},{"time":1466330400,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":86.68,"apparentTemperature":101.27,"dewPoint":79.29,"humidity":0.79,"windSpeed":8.08,"windBearing":134,"cloudCover":0.56,"pressure":1008.8,"ozone":277.07},{"time":1466334000,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipIntensity":0,"precipProbability":0,"temperature":84.96,"apparentTemperature":97.97,"dewPoint":79.13,"humidity":0.83,"windSpeed":7.8,"windBearing":129,"cloudCover":0.55,"pressure":1009.14,"ozone":276.75},{"time":1466337600,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":83.51,"apparentTemperature":94.91,"dewPoint":78.87,"humidity":0.86,"windSpeed":7.61,"windBearing":125,"cloudCover":0.57,"pressure":1009.44,"ozone":276.24},{"time":1466341200,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":82.57,"apparentTemperature":92.84,"dewPoint":78.6,"humidity":0.88,"windSpeed":7.6,"windBearing":124,"cloudCover":0.65,"pressure":1009.71,"ozone":275.37},{"time":1466344800,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":81.92,"apparentTemperature":91.41,"dewPoint":78.38,"humidity":0.89,"windSpeed":7.62,"windBearing":125,"cloudCover":0.76,"pressure":1010.04,"ozone":274.31},{"time":1466348400,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":81.41,"apparentTemperature":90.24,"dewPoint":78.18,"humidity":0.9,"windSpeed":7.46,"windBearing":126,"cloudCover":0.84,"pressure":1010.18,"ozone":273.5},{"time":1466352000,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":81,"apparentTemperature":89.31,"dewPoint":78.02,"humidity":0.91,"windSpeed":6.96,"windBearing":128,"cloudCover":0.88,"pressure":1009.96,"ozone":273.15},{"time":1466355600,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0,"precipProbability":0,"temperature":80.78,"apparentTemperature":88.81,"dewPoint":77.92,"humidity":0.91,"windSpeed":6.3,"windBearing":130,"cloudCover":0.9,"pressure":1009.53,"ozone":273.05},{"time":1466359200,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipIntensity":0.0009,"precipProbability":0.01,"precipType":"rain","temperature":80.71,"apparentTemperature":88.67,"dewPoint":77.9,"humidity":0.91,"windSpeed":5.76,"windBearing":133,"cloudCover":0.91,"pressure":1009.13,"ozone":273.03},{"time":1466362800,"summary":"Overcast","icon":"cloudy","precipIntensity":0.001,"precipProbability":0.01,"precipType":"rain","temperature":80.72,"apparentTemperature":88.75,"dewPoint":77.97,"humidity":0.91,"windSpeed":5.4,"windBearing":134,"cloudCover":0.95,"pressure":1008.79,"ozone":273.05},{"time":1466366400,"summary":"Overcast","icon":"cloudy","precipIntensity":0.0012,"precipProbability":0.02,"precipType":"rain","temperature":80.87,"apparentTemperature":89.19,"dewPoint":78.13,"humidity":0.91,"windSpeed":5.13,"windBearing":135,"cloudCover":0.98,"pressure":1008.53,"ozone":273.15},{"time":1466370000,"summary":"Overcast","icon":"cloudy","precipIntensity":0.0014,"precipProbability":0.03,"precipType":"rain","temperature":81.33,"apparentTemperature":90.31,"dewPoint":78.38,"humidity":0.91,"windSpeed":4.9,"windBearing":135,"cloudCover":1,"pressure":1008.45,"ozone":273.24},{"time":1466373600,"summary":"Overcast","icon":"cloudy","precipIntensity":0.0015,"precipProbability":0.03,"precipType":"rain","temperature":82.17,"apparentTemperature":92.22,"dewPoint":78.69,"humidity":0.89,"windSpeed":4.69,"windBearing":134,"cloudCover":1,"pressure":1008.7,"ozone":273.36},{"time":1466377200,"summary":"Overcast","icon":"cloudy","precipIntensity":0.0017,"precipProbability":0.04,"precipType":"rain","temperature":83.25,"apparentTemperature":94.6,"dewPoint":79.01,"humidity":0.87,"windSpeed":4.53,"windBearing":132,"cloudCover":1,"pressure":1009.16,"ozone":273.47},{"time":1466380800,"summary":"Overcast","icon":"cloudy","precipIntensity":0.0019,"precipProbability":0.04,"precipType":"rain","temperature":84.37,"apparentTemperature":97.08,"dewPoint":79.33,"humidity":0.85,"windSpeed":4.45,"windBearing":133,"cloudCover":1,"pressure":1009.49,"ozone":273.4},{"time":1466384400,"summary":"Overcast","icon":"cloudy","precipIntensity":0.0024,"precipProbability":0.07,"precipType":"rain","temperature":85.51,"apparentTemperature":99.61,"dewPoint":79.61,"humidity":0.83,"windSpeed":4.5,"windBearing":137,"cloudCover":1,"pressure":1009.64,"ozone":272.96}]},"daily":{"summary":"Drizzle today and Saturday, with temperatures falling to 88°F on Saturday.","icon":"rain","data":[{"time":1466179200,"summary":"Light rain until afternoon.","icon":"rain","sunriseTime":1466199654,"sunsetTime":1466248266,"moonPhase":0.42,"precipIntensity":0.0063,"precipIntensityMax":0.0137,"precipIntensityMaxTime":1466179200,"precipProbability":0.49,"precipType":"rain","temperatureMin":80.94,"temperatureMinTime":1466193600,"temperatureMax":89.23,"temperatureMaxTime":1466229600,"apparentTemperatureMin":88.92,"apparentTemperatureMinTime":1466197200,"apparentTemperatureMax":108.5,"apparentTemperatureMaxTime":1466229600,"dewPoint":78.63,"humidity":0.85,"windSpeed":9.17,"windBearing":181,"visibility":6.21,"cloudCover":0.5,"pressure":1009.93,"ozone":276.44},{"time":1466265600,"summary":"Mostly cloudy throughout the day.","icon":"partly-cloudy-day","sunriseTime":1466286064,"sunsetTime":1466334680,"moonPhase":0.45,"precipIntensity":0,"precipIntensityMax":0,"precipProbability":0,"temperatureMin":79.42,"temperatureMinTime":1466280000,"temperatureMax":90.7,"temperatureMaxTime":1466316000,"apparentTemperatureMin":79.42,"apparentTemperatureMinTime":1466280000,"apparentTemperatureMax":108.34,"apparentTemperatureMaxTime":1466316000,"dewPoint":78.09,"humidity":0.82,"windSpeed":7.65,"windBearing":140,"cloudCover":0.61,"pressure":1010.41,"ozone":277.7},{"time":1466352000,"summary":"Mostly cloudy throughout the day.","icon":"partly-cloudy-day","sunriseTime":1466372475,"sunsetTime":1466421094,"moonPhase":0.48,"precipIntensity":0.0015,"precipIntensityMax":0.0034,"precipIntensityMaxTime":1466391600,"precipProbability":0.11,"precipType":"rain","temperatureMin":80.15,"temperatureMinTime":1466434800,"temperatureMax":89.44,"temperatureMaxTime":1466402400,"apparentTemperatureMin":86.07,"apparentTemperatureMinTime":1466434800,"apparentTemperatureMax":107.16,"apparentTemperatureMaxTime":1466402400,"dewPoint":78.32,"humidity":0.84,"windSpeed":5.57,"windBearing":153,"cloudCover":0.9,"pressure":1008.58,"ozone":272.9},{"time":1466438400,"summary":"Mostly cloudy throughout the day.","icon":"partly-cloudy-day","sunriseTime":1466458886,"sunsetTime":1466507506,"moonPhase":0.52,"precipIntensity":0.0012,"precipIntensityMax":0.0022,"precipIntensityMaxTime":1466481600,"precipProbability":0.06,"precipType":"rain","temperatureMin":79.23,"temperatureMinTime":1466452800,"temperatureMax":90.61,"temperatureMaxTime":1466488800,"apparentTemperatureMin":79.23,"apparentTemperatureMinTime":1466452800,"apparentTemperatureMax":107.24,"apparentTemperatureMaxTime":1466488800,"dewPoint":76.87,"humidity":0.81,"windSpeed":7.86,"windBearing":172,"cloudCover":0.88,"pressure":1008.94,"ozone":271.67},{"time":1466524800,"summary":"Mostly cloudy throughout the day.","icon":"partly-cloudy-day","sunriseTime":1466545299,"sunsetTime":1466593918,"moonPhase":0.55,"precipIntensity":0.0013,"precipIntensityMax":0.0023,"precipIntensityMaxTime":1466564400,"precipProbability":0.06,"precipType":"rain","temperatureMin":79.61,"temperatureMinTime":1466539200,"temperatureMax":88.88,"temperatureMaxTime":1466568000,"apparentTemperatureMin":79.61,"apparentTemperatureMinTime":1466539200,"apparentTemperatureMax":101.25,"apparentTemperatureMaxTime":1466568000,"dewPoint":76.36,"humidity":0.79,"windSpeed":8.1,"windBearing":169,"cloudCover":0.72,"pressure":1009.49,"ozone":273.94},{"time":1466611200,"summary":"Partly cloudy throughout the day.","icon":"partly-cloudy-day","sunriseTime":1466631712,"sunsetTime":1466680329,"moonPhase":0.59,"precipIntensity":0.0011,"precipIntensityMax":0.0024,"precipIntensityMaxTime":1466647200,"precipProbability":0.07,"precipType":"rain","temperatureMin":79.93,"temperatureMinTime":1466625600,"temperatureMax":88.46,"temperatureMaxTime":1466654400,"apparentTemperatureMin":79.93,"apparentTemperatureMinTime":1466625600,"apparentTemperatureMax":99.6,"apparentTemperatureMaxTime":1466654400,"dewPoint":75.95,"humidity":0.78,"windSpeed":7.74,"windBearing":171,"cloudCover":0.55,"pressure":1009.26,"ozone":276.22},{"time":1466697600,"summary":"Mostly cloudy throughout the day.","icon":"partly-cloudy-day","sunriseTime":1466718126,"sunsetTime":1466766739,"moonPhase":0.62,"precipIntensity":0.0008,"precipIntensityMax":0.0021,"precipIntensityMaxTime":1466737200,"precipProbability":0.05,"precipType":"rain","temperatureMin":80.03,"temperatureMinTime":1466715600,"temperatureMax":88.36,"temperatureMaxTime":1466744400,"apparentTemperatureMin":85.87,"apparentTemperatureMinTime":1466715600,"apparentTemperatureMax":100.48,"apparentTemperatureMaxTime":1466744400,"dewPoint":76.4,"humidity":0.8,"windSpeed":7.88,"windBearing":181,"cloudCover":0.54,"pressure":1008.43,"ozone":277.64},{"time":1466784000,"summary":"Drizzle until afternoon, starting again overnight.","icon":"rain","sunriseTime":1466804541,"sunsetTime":1466853148,"moonPhase":0.66,"precipIntensity":0.0035,"precipIntensityMax":0.0056,"precipIntensityMaxTime":1466823600,"precipProbability":0.23,"precipType":"rain","temperatureMin":80.29,"temperatureMinTime":1466798400,"temperatureMax":87.88,"temperatureMaxTime":1466827200,"apparentTemperatureMin":86.67,"apparentTemperatureMinTime":1466798400,"apparentTemperatureMax":98.99,"apparentTemperatureMaxTime":1466827200,"dewPoint":76.63,"humidity":0.8,"windSpeed":7.94,"windBearing":179,"cloudCover":0.67,"pressure":1007.78,"ozone":274.81}]},"flags":{"sources":["gfs","cmc","fnmoc","isd","madis"],"isd-stations":["450040-99999","450050-99999","450090-99999","450350-99999","450390-99999"],"madis-stations":["C6AV5","ELZU3","VHHH","VMMC","ZGSZ","ZLZU3"],"units":"us"}}
In [4]:
print(data.keys())
dict_keys(['daily', 'latitude', 'timezone', 'flags', 'currently', 'offset', 'hourly', 'longitude'])
In [5]:
print(data['currently'])
{'time': 1466214023, 'visibility': 6.21, 'cloudCover': 0.21, 'temperature': 84.21, 'precipIntensity': 0.0066, 'precipProbability': 0.28, 'windSpeed': 9.93, 'apparentTemperature': 95.54, 'humidity': 0.82, 'dewPoint': 78.26, 'summary': 'Clear', 'windBearing': 193, 'ozone': 276.46, 'icon': 'clear-day', 'precipType': 'rain', 'pressure': 1010.45}
In [6]:
print(data['currently']['windSpeed'])
9.93
In [7]:
print("Current temperature is", (data['currently']['temperature']))
print("Current temperature feels like", (data['currently']['apparentTemperature']))
Current temperature is 84.21
Current temperature feels like 95.54
In [8]:
today = data['daily']['data']
for moon in today:
print(moon['moonPhase'])
0.42
0.45
0.48
0.52
0.55
0.59
0.62
0.66
In [9]:
for temp in today:
print("The difference between the high and low predicted temperatures of the day is",
(temp['temperatureMax'])-(temp['temperatureMin']))
The difference between the high and low predicted temperatures of the day is 8.290000000000006
The difference between the high and low predicted temperatures of the day is 11.280000000000001
The difference between the high and low predicted temperatures of the day is 9.289999999999992
The difference between the high and low predicted temperatures of the day is 11.379999999999995
The difference between the high and low predicted temperatures of the day is 9.269999999999996
The difference between the high and low predicted temperatures of the day is 8.529999999999987
The difference between the high and low predicted temperatures of the day is 8.329999999999998
The difference between the high and low predicted temperatures of the day is 7.589999999999989
In [10]:
for week in today:
print("The predicted high temperature for the day is", week['temperatureMax'])
if week['temperatureMax'] >= 80:
print("That is hot weather, imo.")
elif week['temperatureMax'] >=65 and week['temperatureMax'] < 80:
print("That is warm weather, imo.")
elif week['temperatureMax'] < 65:
print("That is cold weather, imo.")
The predicted high temperature for the day is 89.23
That is hot weather, imo.
The predicted high temperature for the day is 90.7
That is hot weather, imo.
The predicted high temperature for the day is 89.44
That is hot weather, imo.
The predicted high temperature for the day is 90.61
That is hot weather, imo.
The predicted high temperature for the day is 88.88
That is hot weather, imo.
The predicted high temperature for the day is 88.46
That is hot weather, imo.
The predicted high temperature for the day is 88.36
That is hot weather, imo.
The predicted high temperature for the day is 87.88
That is hot weather, imo.
In [11]:
miami_response = requests.get('https://api.forecast.io/forecast/a69e446312b60b9982fba351359a544f/25.7617,80.1918')
miami_data = miami_response.json()
In [12]:
miami_hourly = miami_data['hourly']
print(miami_hourly)
{'data': [{'time': 1466213400, 'cloudCover': 0.56, 'temperature': 91.7, 'precipIntensity': 0.0023, 'precipProbability': 0.06, 'windSpeed': 7.18, 'apparentTemperature': 100.23, 'humidity': 0.54, 'dewPoint': 72.73, 'summary': 'Partly Cloudy', 'windBearing': 81, 'ozone': 278.36, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.81}, {'time': 1466217000, 'cloudCover': 0.64, 'temperature': 93.63, 'precipIntensity': 0.0023, 'precipProbability': 0.06, 'windSpeed': 7.85, 'apparentTemperature': 102.73, 'humidity': 0.51, 'dewPoint': 72.76, 'summary': 'Mostly Cloudy', 'windBearing': 83, 'ozone': 277.97, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1001.07}, {'time': 1466220600, 'cloudCover': 0.69, 'temperature': 95.06, 'precipIntensity': 0.0029, 'precipProbability': 0.09, 'windSpeed': 8.17, 'apparentTemperature': 104.33, 'humidity': 0.49, 'dewPoint': 72.55, 'summary': 'Mostly Cloudy', 'windBearing': 82, 'ozone': 277.44, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1001.08}, {'time': 1466224200, 'cloudCover': 0.7, 'temperature': 96.12, 'precipIntensity': 0.0041, 'precipProbability': 0.15, 'windSpeed': 8.25, 'apparentTemperature': 105.24, 'humidity': 0.46, 'dewPoint': 72.15, 'summary': 'Mostly Cloudy', 'windBearing': 78, 'ozone': 276.79, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.85}, {'time': 1466227800, 'cloudCover': 0.71, 'temperature': 97.06, 'precipIntensity': 0.0053, 'precipProbability': 0.21, 'windSpeed': 8.28, 'apparentTemperature': 106.09, 'humidity': 0.45, 'dewPoint': 71.83, 'summary': 'Drizzle', 'windBearing': 73, 'ozone': 276.09, 'icon': 'rain', 'precipType': 'rain', 'pressure': 1000.51}, {'time': 1466231400, 'cloudCover': 0.76, 'temperature': 98.11, 'precipIntensity': 0.0055, 'precipProbability': 0.22, 'windSpeed': 8.37, 'apparentTemperature': 107.53, 'humidity': 0.43, 'dewPoint': 71.92, 'summary': 'Drizzle', 'windBearing': 71, 'ozone': 275.35, 'icon': 'rain', 'precipType': 'rain', 'pressure': 1000.11}, {'time': 1466235000, 'cloudCover': 0.86, 'temperature': 99.32, 'precipIntensity': 0.005, 'precipProbability': 0.19, 'windSpeed': 8.45, 'apparentTemperature': 109.66, 'humidity': 0.42, 'dewPoint': 72.42, 'summary': 'Drizzle', 'windBearing': 71, 'ozone': 274.49, 'icon': 'rain', 'precipType': 'rain', 'pressure': 999.56}, {'time': 1466238600, 'cloudCover': 0.95, 'temperature': 100.5, 'precipIntensity': 0.0046, 'precipProbability': 0.17, 'windSpeed': 8.52, 'apparentTemperature': 111.97, 'humidity': 0.42, 'dewPoint': 73.08, 'summary': 'Overcast', 'windBearing': 71, 'ozone': 273.76, 'icon': 'cloudy', 'precipType': 'rain', 'pressure': 998.99}, {'time': 1466242200, 'cloudCover': 0.99, 'temperature': 101.38, 'precipIntensity': 0.0049, 'precipProbability': 0.19, 'windSpeed': 8.65, 'apparentTemperature': 113.75, 'humidity': 0.41, 'dewPoint': 73.58, 'summary': 'Overcast', 'windBearing': 71, 'ozone': 273.46, 'icon': 'cloudy', 'precipType': 'rain', 'pressure': 998.51}, {'time': 1466245800, 'cloudCover': 0.98, 'temperature': 101.82, 'precipIntensity': 0.0055, 'precipProbability': 0.22, 'windSpeed': 8.87, 'apparentTemperature': 114.57, 'humidity': 0.41, 'dewPoint': 73.76, 'summary': 'Drizzle', 'windBearing': 69, 'ozone': 273.6, 'icon': 'rain', 'precipType': 'rain', 'pressure': 998.09}, {'time': 1466249400, 'cloudCover': 0.96, 'temperature': 101.26, 'precipIntensity': 0.006, 'precipProbability': 0.25, 'windSpeed': 8.95, 'apparentTemperature': 113.27, 'humidity': 0.41, 'dewPoint': 73.32, 'summary': 'Drizzle', 'windBearing': 68, 'ozone': 273.89, 'icon': 'rain', 'precipType': 'rain', 'pressure': 997.85}, {'time': 1466253000, 'cloudCover': 0.93, 'temperature': 100.16, 'precipIntensity': 0.0059, 'precipProbability': 0.24, 'windSpeed': 8.51, 'apparentTemperature': 111.35, 'humidity': 0.42, 'dewPoint': 72.92, 'summary': 'Drizzle', 'windBearing': 69, 'ozone': 274.07, 'icon': 'rain', 'precipType': 'rain', 'pressure': 997.97}, {'time': 1466256600, 'cloudCover': 0.89, 'temperature': 98.57, 'precipIntensity': 0.0053, 'precipProbability': 0.21, 'windSpeed': 7.44, 'apparentTemperature': 108.95, 'humidity': 0.44, 'dewPoint': 72.65, 'summary': 'Drizzle', 'windBearing': 70, 'ozone': 274.26, 'icon': 'rain', 'precipType': 'rain', 'pressure': 998.49}, {'time': 1466260200, 'cloudCover': 0.85, 'temperature': 96.94, 'precipIntensity': 0.0043, 'precipProbability': 0.16, 'windSpeed': 6.49, 'apparentTemperature': 106.69, 'humidity': 0.46, 'dewPoint': 72.52, 'summary': 'Mostly Cloudy', 'windBearing': 72, 'ozone': 274.41, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.14}, {'time': 1466263800, 'cloudCover': 0.84, 'temperature': 95.69, 'precipIntensity': 0.0032, 'precipProbability': 0.1, 'windSpeed': 6.39, 'apparentTemperature': 105.15, 'humidity': 0.48, 'dewPoint': 72.56, 'summary': 'Mostly Cloudy', 'windBearing': 73, 'ozone': 274.45, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.67}, {'time': 1466267400, 'cloudCover': 0.86, 'temperature': 94.8, 'precipIntensity': 0.0021, 'precipProbability': 0.05, 'windSpeed': 7.11, 'apparentTemperature': 104.24, 'humidity': 0.49, 'dewPoint': 72.77, 'summary': 'Mostly Cloudy', 'windBearing': 71, 'ozone': 274.4, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 1000.14}, {'time': 1466271000, 'cloudCover': 0.88, 'temperature': 94.11, 'precipIntensity': 0.0012, 'precipProbability': 0.02, 'windSpeed': 8.06, 'apparentTemperature': 103.69, 'humidity': 0.51, 'dewPoint': 73.07, 'summary': 'Mostly Cloudy', 'windBearing': 71, 'ozone': 274.28, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 1000.45}, {'time': 1466274600, 'cloudCover': 0.91, 'temperature': 93.44, 'precipIntensity': 0.0008, 'precipProbability': 0.01, 'windSpeed': 8.75, 'apparentTemperature': 103.2, 'humidity': 0.52, 'dewPoint': 73.39, 'summary': 'Mostly Cloudy', 'windBearing': 75, 'ozone': 274.06, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 1000.46}, {'time': 1466278200, 'cloudCover': 0.95, 'temperature': 92.69, 'precipIntensity': 0, 'precipProbability': 0, 'windSpeed': 9.53, 'apparentTemperature': 102.62, 'humidity': 0.54, 'dewPoint': 73.72, 'summary': 'Overcast', 'windBearing': 83, 'ozone': 273.75, 'icon': 'cloudy', 'pressure': 1000.15}, {'time': 1466281800, 'cloudCover': 0.98, 'temperature': 91.85, 'precipIntensity': 0.0009, 'precipProbability': 0.01, 'windSpeed': 10.32, 'apparentTemperature': 101.75, 'humidity': 0.56, 'dewPoint': 73.91, 'summary': 'Overcast', 'windBearing': 90, 'ozone': 273.36, 'icon': 'cloudy', 'precipType': 'rain', 'pressure': 999.82}, {'time': 1466285400, 'cloudCover': 0.99, 'temperature': 90.83, 'precipIntensity': 0.0012, 'precipProbability': 0.02, 'windSpeed': 10.62, 'apparentTemperature': 100.39, 'humidity': 0.58, 'dewPoint': 73.89, 'summary': 'Overcast', 'windBearing': 93, 'ozone': 272.83, 'icon': 'cloudy', 'precipType': 'rain', 'pressure': 999.71}, {'time': 1466289000, 'cloudCover': 0.99, 'temperature': 89.5, 'precipIntensity': 0.0016, 'precipProbability': 0.03, 'windSpeed': 10.24, 'apparentTemperature': 98.38, 'humidity': 0.6, 'dewPoint': 73.63, 'summary': 'Overcast', 'windBearing': 93, 'ozone': 272.08, 'icon': 'cloudy', 'precipType': 'rain', 'pressure': 999.75}, {'time': 1466292600, 'cloudCover': 0.96, 'temperature': 88.61, 'precipIntensity': 0.0019, 'precipProbability': 0.04, 'windSpeed': 9.88, 'apparentTemperature': 96.94, 'humidity': 0.61, 'dewPoint': 73.36, 'summary': 'Overcast', 'windBearing': 92, 'ozone': 271.42, 'icon': 'cloudy', 'precipType': 'rain', 'pressure': 999.91}, {'time': 1466296200, 'cloudCover': 0.87, 'temperature': 89.78, 'precipIntensity': 0.0021, 'precipProbability': 0.05, 'windSpeed': 10.26, 'apparentTemperature': 99.3, 'humidity': 0.6, 'dewPoint': 74.13, 'summary': 'Mostly Cloudy', 'windBearing': 93, 'ozone': 271.26, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.21}, {'time': 1466299800, 'cloudCover': 0.72, 'temperature': 91.75, 'precipIntensity': 0.0022, 'precipProbability': 0.06, 'windSpeed': 11.37, 'apparentTemperature': 102.54, 'humidity': 0.58, 'dewPoint': 74.68, 'summary': 'Mostly Cloudy', 'windBearing': 95, 'ozone': 271.58, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.75}, {'time': 1466303400, 'cloudCover': 0.56, 'temperature': 93.8, 'precipIntensity': 0.0024, 'precipProbability': 0.07, 'windSpeed': 12.54, 'apparentTemperature': 105.27, 'humidity': 0.54, 'dewPoint': 74.71, 'summary': 'Partly Cloudy', 'windBearing': 97, 'ozone': 271.99, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1001.26}, {'time': 1466307000, 'cloudCover': 0.49, 'temperature': 96.02, 'precipIntensity': 0.0025, 'precipProbability': 0.07, 'windSpeed': 13.16, 'apparentTemperature': 108.13, 'humidity': 0.51, 'dewPoint': 74.67, 'summary': 'Partly Cloudy', 'windBearing': 97, 'ozone': 272.08, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1001.37}, {'time': 1466310600, 'cloudCover': 0.48, 'temperature': 99.38, 'precipIntensity': 0.0027, 'precipProbability': 0.08, 'windSpeed': 13.33, 'apparentTemperature': 113.17, 'humidity': 0.46, 'dewPoint': 75.12, 'summary': 'Partly Cloudy', 'windBearing': 97, 'ozone': 271.92, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1001.15}, {'time': 1466314200, 'cloudCover': 0.51, 'temperature': 103.06, 'precipIntensity': 0.0028, 'precipProbability': 0.08, 'windSpeed': 13.29, 'apparentTemperature': 119.25, 'humidity': 0.43, 'dewPoint': 75.96, 'summary': 'Partly Cloudy', 'windBearing': 96, 'ozone': 271.72, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.76}, {'time': 1466317800, 'cloudCover': 0.57, 'temperature': 105.24, 'precipIntensity': 0.0028, 'precipProbability': 0.08, 'windSpeed': 13.16, 'apparentTemperature': 123.07, 'humidity': 0.41, 'dewPoint': 76.55, 'summary': 'Partly Cloudy', 'windBearing': 96, 'ozone': 271.69, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.28}, {'time': 1466321400, 'cloudCover': 0.69, 'temperature': 104.82, 'precipIntensity': 0.0029, 'precipProbability': 0.09, 'windSpeed': 12.91, 'apparentTemperature': 121.57, 'humidity': 0.41, 'dewPoint': 75.94, 'summary': 'Mostly Cloudy', 'windBearing': 96, 'ozone': 271.83, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 999.57}, {'time': 1466325000, 'cloudCover': 0.81, 'temperature': 103.83, 'precipIntensity': 0.003, 'precipProbability': 0.09, 'windSpeed': 12.55, 'apparentTemperature': 119.27, 'humidity': 0.41, 'dewPoint': 75.26, 'summary': 'Mostly Cloudy', 'windBearing': 95, 'ozone': 271.95, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 998.83}, {'time': 1466328600, 'cloudCover': 0.87, 'temperature': 103, 'precipIntensity': 0.003, 'precipProbability': 0.09, 'windSpeed': 12.07, 'apparentTemperature': 117.15, 'humidity': 0.41, 'dewPoint': 74.54, 'summary': 'Mostly Cloudy', 'windBearing': 93, 'ozone': 271.87, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 998.24}, {'time': 1466332200, 'cloudCover': 0.86, 'temperature': 102.28, 'precipIntensity': 0.003, 'precipProbability': 0.09, 'windSpeed': 11.45, 'apparentTemperature': 115.3, 'humidity': 0.41, 'dewPoint': 73.86, 'summary': 'Mostly Cloudy', 'windBearing': 89, 'ozone': 271.61, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 997.76}, {'time': 1466335800, 'cloudCover': 0.83, 'temperature': 101.5, 'precipIntensity': 0.0029, 'precipProbability': 0.09, 'windSpeed': 10.86, 'apparentTemperature': 113.58, 'humidity': 0.41, 'dewPoint': 73.31, 'summary': 'Mostly Cloudy', 'windBearing': 86, 'ozone': 271.29, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 997.52}, {'time': 1466339400, 'cloudCover': 0.83, 'temperature': 100.51, 'precipIntensity': 0.0028, 'precipProbability': 0.08, 'windSpeed': 10.41, 'apparentTemperature': 111.87, 'humidity': 0.42, 'dewPoint': 72.98, 'summary': 'Mostly Cloudy', 'windBearing': 85, 'ozone': 270.99, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 997.66}, {'time': 1466343000, 'cloudCover': 0.86, 'temperature': 99.32, 'precipIntensity': 0.0025, 'precipProbability': 0.07, 'windSpeed': 10.08, 'apparentTemperature': 110.21, 'humidity': 0.43, 'dewPoint': 72.88, 'summary': 'Mostly Cloudy', 'windBearing': 88, 'ozone': 270.66, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 998.23}, {'time': 1466346600, 'cloudCover': 0.88, 'temperature': 98.13, 'precipIntensity': 0.0022, 'precipProbability': 0.06, 'windSpeed': 9.77, 'apparentTemperature': 108.78, 'humidity': 0.45, 'dewPoint': 72.98, 'summary': 'Mostly Cloudy', 'windBearing': 91, 'ozone': 270.36, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 998.9}, {'time': 1466350200, 'cloudCover': 0.87, 'temperature': 97.09, 'precipIntensity': 0.0018, 'precipProbability': 0.04, 'windSpeed': 9.34, 'apparentTemperature': 107.69, 'humidity': 0.47, 'dewPoint': 73.2, 'summary': 'Mostly Cloudy', 'windBearing': 93, 'ozone': 270.16, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.33}, {'time': 1466353800, 'cloudCover': 0.83, 'temperature': 96.12, 'precipIntensity': 0.0014, 'precipProbability': 0.03, 'windSpeed': 8.82, 'apparentTemperature': 106.7, 'humidity': 0.48, 'dewPoint': 73.42, 'summary': 'Mostly Cloudy', 'windBearing': 95, 'ozone': 270.07, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.56}, {'time': 1466357400, 'cloudCover': 0.8, 'temperature': 95.22, 'precipIntensity': 0.0012, 'precipProbability': 0.02, 'windSpeed': 8.27, 'apparentTemperature': 105.82, 'humidity': 0.5, 'dewPoint': 73.66, 'summary': 'Mostly Cloudy', 'windBearing': 97, 'ozone': 269.98, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.68}, {'time': 1466361000, 'cloudCover': 0.77, 'temperature': 94.42, 'precipIntensity': 0.0009, 'precipProbability': 0.01, 'windSpeed': 7.77, 'apparentTemperature': 105.1, 'humidity': 0.52, 'dewPoint': 73.92, 'summary': 'Mostly Cloudy', 'windBearing': 101, 'ozone': 269.71, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.66}, {'time': 1466364600, 'cloudCover': 0.74, 'temperature': 93.62, 'precipIntensity': 0, 'precipProbability': 0, 'windSpeed': 7.31, 'apparentTemperature': 104.43, 'humidity': 0.54, 'dewPoint': 74.23, 'summary': 'Mostly Cloudy', 'windBearing': 106, 'ozone': 269.25, 'icon': 'partly-cloudy-night', 'pressure': 999.48}, {'time': 1466368200, 'cloudCover': 0.72, 'temperature': 92.76, 'precipIntensity': 0, 'precipProbability': 0, 'windSpeed': 6.93, 'apparentTemperature': 103.62, 'humidity': 0.56, 'dewPoint': 74.48, 'summary': 'Mostly Cloudy', 'windBearing': 112, 'ozone': 268.85, 'icon': 'partly-cloudy-night', 'pressure': 999.3}, {'time': 1466371800, 'cloudCover': 0.73, 'temperature': 91.74, 'precipIntensity': 0.0022, 'precipProbability': 0.06, 'windSpeed': 6.53, 'apparentTemperature': 102.47, 'humidity': 0.58, 'dewPoint': 74.63, 'summary': 'Mostly Cloudy', 'windBearing': 116, 'ozone': 268.76, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.24}, {'time': 1466375400, 'cloudCover': 0.78, 'temperature': 90.45, 'precipIntensity': 0.0057, 'precipProbability': 0.23, 'windSpeed': 6.04, 'apparentTemperature': 100.83, 'humidity': 0.6, 'dewPoint': 74.69, 'summary': 'Drizzle', 'windBearing': 119, 'ozone': 268.96, 'icon': 'rain', 'precipType': 'rain', 'pressure': 999.32}, {'time': 1466379000, 'cloudCover': 0.83, 'temperature': 89.56, 'precipIntensity': 0.0087, 'precipProbability': 0.41, 'windSpeed': 5.66, 'apparentTemperature': 99.58, 'humidity': 0.62, 'dewPoint': 74.64, 'summary': 'Drizzle', 'windBearing': 122, 'ozone': 269.3, 'icon': 'rain', 'precipType': 'rain', 'pressure': 999.5}, {'time': 1466382600, 'cloudCover': 0.87, 'temperature': 90.34, 'precipIntensity': 0.0087, 'precipProbability': 0.41, 'windSpeed': 5.64, 'apparentTemperature': 101.07, 'humidity': 0.61, 'dewPoint': 75, 'summary': 'Drizzle', 'windBearing': 127, 'ozone': 269.68, 'icon': 'rain', 'precipType': 'rain', 'pressure': 999.72}, {'time': 1466386200, 'cloudCover': 0.91, 'temperature': 92.19, 'precipIntensity': 0.0058, 'precipProbability': 0.24, 'windSpeed': 6.03, 'apparentTemperature': 103.68, 'humidity': 0.58, 'dewPoint': 75.13, 'summary': 'Drizzle', 'windBearing': 135, 'ozone': 270.19, 'icon': 'rain', 'precipType': 'rain', 'pressure': 1000.07}], 'summary': 'Drizzle until this evening.', 'icon': 'rain'}
In [15]:
#TA-Stephan: You can't do a for loop on a dictionary
for hour in miami_hourly:
print(type(hour))
print ("Time:", hour['time'], "Temperature:", hour['temperature'])
<class 'dict'>
<class 'str'>
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-15-50e0f704b0df> in <module>()
2 for hour in miami_hourly:
3 print(type(hour))
----> 4 print ("Time:", hour['time'], "Temperature:", hour['temperature'])
TypeError: string indices must be integers
In [16]:
print(miami_hourly.keys())
dict_keys(['data', 'summary', 'icon'])
In [17]:
print(miami_hourly['data'])
[{'time': 1466213400, 'cloudCover': 0.56, 'temperature': 91.7, 'precipIntensity': 0.0023, 'precipProbability': 0.06, 'windSpeed': 7.18, 'apparentTemperature': 100.23, 'humidity': 0.54, 'dewPoint': 72.73, 'summary': 'Partly Cloudy', 'windBearing': 81, 'ozone': 278.36, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.81}, {'time': 1466217000, 'cloudCover': 0.64, 'temperature': 93.63, 'precipIntensity': 0.0023, 'precipProbability': 0.06, 'windSpeed': 7.85, 'apparentTemperature': 102.73, 'humidity': 0.51, 'dewPoint': 72.76, 'summary': 'Mostly Cloudy', 'windBearing': 83, 'ozone': 277.97, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1001.07}, {'time': 1466220600, 'cloudCover': 0.69, 'temperature': 95.06, 'precipIntensity': 0.0029, 'precipProbability': 0.09, 'windSpeed': 8.17, 'apparentTemperature': 104.33, 'humidity': 0.49, 'dewPoint': 72.55, 'summary': 'Mostly Cloudy', 'windBearing': 82, 'ozone': 277.44, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1001.08}, {'time': 1466224200, 'cloudCover': 0.7, 'temperature': 96.12, 'precipIntensity': 0.0041, 'precipProbability': 0.15, 'windSpeed': 8.25, 'apparentTemperature': 105.24, 'humidity': 0.46, 'dewPoint': 72.15, 'summary': 'Mostly Cloudy', 'windBearing': 78, 'ozone': 276.79, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.85}, {'time': 1466227800, 'cloudCover': 0.71, 'temperature': 97.06, 'precipIntensity': 0.0053, 'precipProbability': 0.21, 'windSpeed': 8.28, 'apparentTemperature': 106.09, 'humidity': 0.45, 'dewPoint': 71.83, 'summary': 'Drizzle', 'windBearing': 73, 'ozone': 276.09, 'icon': 'rain', 'precipType': 'rain', 'pressure': 1000.51}, {'time': 1466231400, 'cloudCover': 0.76, 'temperature': 98.11, 'precipIntensity': 0.0055, 'precipProbability': 0.22, 'windSpeed': 8.37, 'apparentTemperature': 107.53, 'humidity': 0.43, 'dewPoint': 71.92, 'summary': 'Drizzle', 'windBearing': 71, 'ozone': 275.35, 'icon': 'rain', 'precipType': 'rain', 'pressure': 1000.11}, {'time': 1466235000, 'cloudCover': 0.86, 'temperature': 99.32, 'precipIntensity': 0.005, 'precipProbability': 0.19, 'windSpeed': 8.45, 'apparentTemperature': 109.66, 'humidity': 0.42, 'dewPoint': 72.42, 'summary': 'Drizzle', 'windBearing': 71, 'ozone': 274.49, 'icon': 'rain', 'precipType': 'rain', 'pressure': 999.56}, {'time': 1466238600, 'cloudCover': 0.95, 'temperature': 100.5, 'precipIntensity': 0.0046, 'precipProbability': 0.17, 'windSpeed': 8.52, 'apparentTemperature': 111.97, 'humidity': 0.42, 'dewPoint': 73.08, 'summary': 'Overcast', 'windBearing': 71, 'ozone': 273.76, 'icon': 'cloudy', 'precipType': 'rain', 'pressure': 998.99}, {'time': 1466242200, 'cloudCover': 0.99, 'temperature': 101.38, 'precipIntensity': 0.0049, 'precipProbability': 0.19, 'windSpeed': 8.65, 'apparentTemperature': 113.75, 'humidity': 0.41, 'dewPoint': 73.58, 'summary': 'Overcast', 'windBearing': 71, 'ozone': 273.46, 'icon': 'cloudy', 'precipType': 'rain', 'pressure': 998.51}, {'time': 1466245800, 'cloudCover': 0.98, 'temperature': 101.82, 'precipIntensity': 0.0055, 'precipProbability': 0.22, 'windSpeed': 8.87, 'apparentTemperature': 114.57, 'humidity': 0.41, 'dewPoint': 73.76, 'summary': 'Drizzle', 'windBearing': 69, 'ozone': 273.6, 'icon': 'rain', 'precipType': 'rain', 'pressure': 998.09}, {'time': 1466249400, 'cloudCover': 0.96, 'temperature': 101.26, 'precipIntensity': 0.006, 'precipProbability': 0.25, 'windSpeed': 8.95, 'apparentTemperature': 113.27, 'humidity': 0.41, 'dewPoint': 73.32, 'summary': 'Drizzle', 'windBearing': 68, 'ozone': 273.89, 'icon': 'rain', 'precipType': 'rain', 'pressure': 997.85}, {'time': 1466253000, 'cloudCover': 0.93, 'temperature': 100.16, 'precipIntensity': 0.0059, 'precipProbability': 0.24, 'windSpeed': 8.51, 'apparentTemperature': 111.35, 'humidity': 0.42, 'dewPoint': 72.92, 'summary': 'Drizzle', 'windBearing': 69, 'ozone': 274.07, 'icon': 'rain', 'precipType': 'rain', 'pressure': 997.97}, {'time': 1466256600, 'cloudCover': 0.89, 'temperature': 98.57, 'precipIntensity': 0.0053, 'precipProbability': 0.21, 'windSpeed': 7.44, 'apparentTemperature': 108.95, 'humidity': 0.44, 'dewPoint': 72.65, 'summary': 'Drizzle', 'windBearing': 70, 'ozone': 274.26, 'icon': 'rain', 'precipType': 'rain', 'pressure': 998.49}, {'time': 1466260200, 'cloudCover': 0.85, 'temperature': 96.94, 'precipIntensity': 0.0043, 'precipProbability': 0.16, 'windSpeed': 6.49, 'apparentTemperature': 106.69, 'humidity': 0.46, 'dewPoint': 72.52, 'summary': 'Mostly Cloudy', 'windBearing': 72, 'ozone': 274.41, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.14}, {'time': 1466263800, 'cloudCover': 0.84, 'temperature': 95.69, 'precipIntensity': 0.0032, 'precipProbability': 0.1, 'windSpeed': 6.39, 'apparentTemperature': 105.15, 'humidity': 0.48, 'dewPoint': 72.56, 'summary': 'Mostly Cloudy', 'windBearing': 73, 'ozone': 274.45, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.67}, {'time': 1466267400, 'cloudCover': 0.86, 'temperature': 94.8, 'precipIntensity': 0.0021, 'precipProbability': 0.05, 'windSpeed': 7.11, 'apparentTemperature': 104.24, 'humidity': 0.49, 'dewPoint': 72.77, 'summary': 'Mostly Cloudy', 'windBearing': 71, 'ozone': 274.4, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 1000.14}, {'time': 1466271000, 'cloudCover': 0.88, 'temperature': 94.11, 'precipIntensity': 0.0012, 'precipProbability': 0.02, 'windSpeed': 8.06, 'apparentTemperature': 103.69, 'humidity': 0.51, 'dewPoint': 73.07, 'summary': 'Mostly Cloudy', 'windBearing': 71, 'ozone': 274.28, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 1000.45}, {'time': 1466274600, 'cloudCover': 0.91, 'temperature': 93.44, 'precipIntensity': 0.0008, 'precipProbability': 0.01, 'windSpeed': 8.75, 'apparentTemperature': 103.2, 'humidity': 0.52, 'dewPoint': 73.39, 'summary': 'Mostly Cloudy', 'windBearing': 75, 'ozone': 274.06, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 1000.46}, {'time': 1466278200, 'cloudCover': 0.95, 'temperature': 92.69, 'precipIntensity': 0, 'precipProbability': 0, 'windSpeed': 9.53, 'apparentTemperature': 102.62, 'humidity': 0.54, 'dewPoint': 73.72, 'summary': 'Overcast', 'windBearing': 83, 'ozone': 273.75, 'icon': 'cloudy', 'pressure': 1000.15}, {'time': 1466281800, 'cloudCover': 0.98, 'temperature': 91.85, 'precipIntensity': 0.0009, 'precipProbability': 0.01, 'windSpeed': 10.32, 'apparentTemperature': 101.75, 'humidity': 0.56, 'dewPoint': 73.91, 'summary': 'Overcast', 'windBearing': 90, 'ozone': 273.36, 'icon': 'cloudy', 'precipType': 'rain', 'pressure': 999.82}, {'time': 1466285400, 'cloudCover': 0.99, 'temperature': 90.83, 'precipIntensity': 0.0012, 'precipProbability': 0.02, 'windSpeed': 10.62, 'apparentTemperature': 100.39, 'humidity': 0.58, 'dewPoint': 73.89, 'summary': 'Overcast', 'windBearing': 93, 'ozone': 272.83, 'icon': 'cloudy', 'precipType': 'rain', 'pressure': 999.71}, {'time': 1466289000, 'cloudCover': 0.99, 'temperature': 89.5, 'precipIntensity': 0.0016, 'precipProbability': 0.03, 'windSpeed': 10.24, 'apparentTemperature': 98.38, 'humidity': 0.6, 'dewPoint': 73.63, 'summary': 'Overcast', 'windBearing': 93, 'ozone': 272.08, 'icon': 'cloudy', 'precipType': 'rain', 'pressure': 999.75}, {'time': 1466292600, 'cloudCover': 0.96, 'temperature': 88.61, 'precipIntensity': 0.0019, 'precipProbability': 0.04, 'windSpeed': 9.88, 'apparentTemperature': 96.94, 'humidity': 0.61, 'dewPoint': 73.36, 'summary': 'Overcast', 'windBearing': 92, 'ozone': 271.42, 'icon': 'cloudy', 'precipType': 'rain', 'pressure': 999.91}, {'time': 1466296200, 'cloudCover': 0.87, 'temperature': 89.78, 'precipIntensity': 0.0021, 'precipProbability': 0.05, 'windSpeed': 10.26, 'apparentTemperature': 99.3, 'humidity': 0.6, 'dewPoint': 74.13, 'summary': 'Mostly Cloudy', 'windBearing': 93, 'ozone': 271.26, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.21}, {'time': 1466299800, 'cloudCover': 0.72, 'temperature': 91.75, 'precipIntensity': 0.0022, 'precipProbability': 0.06, 'windSpeed': 11.37, 'apparentTemperature': 102.54, 'humidity': 0.58, 'dewPoint': 74.68, 'summary': 'Mostly Cloudy', 'windBearing': 95, 'ozone': 271.58, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.75}, {'time': 1466303400, 'cloudCover': 0.56, 'temperature': 93.8, 'precipIntensity': 0.0024, 'precipProbability': 0.07, 'windSpeed': 12.54, 'apparentTemperature': 105.27, 'humidity': 0.54, 'dewPoint': 74.71, 'summary': 'Partly Cloudy', 'windBearing': 97, 'ozone': 271.99, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1001.26}, {'time': 1466307000, 'cloudCover': 0.49, 'temperature': 96.02, 'precipIntensity': 0.0025, 'precipProbability': 0.07, 'windSpeed': 13.16, 'apparentTemperature': 108.13, 'humidity': 0.51, 'dewPoint': 74.67, 'summary': 'Partly Cloudy', 'windBearing': 97, 'ozone': 272.08, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1001.37}, {'time': 1466310600, 'cloudCover': 0.48, 'temperature': 99.38, 'precipIntensity': 0.0027, 'precipProbability': 0.08, 'windSpeed': 13.33, 'apparentTemperature': 113.17, 'humidity': 0.46, 'dewPoint': 75.12, 'summary': 'Partly Cloudy', 'windBearing': 97, 'ozone': 271.92, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1001.15}, {'time': 1466314200, 'cloudCover': 0.51, 'temperature': 103.06, 'precipIntensity': 0.0028, 'precipProbability': 0.08, 'windSpeed': 13.29, 'apparentTemperature': 119.25, 'humidity': 0.43, 'dewPoint': 75.96, 'summary': 'Partly Cloudy', 'windBearing': 96, 'ozone': 271.72, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.76}, {'time': 1466317800, 'cloudCover': 0.57, 'temperature': 105.24, 'precipIntensity': 0.0028, 'precipProbability': 0.08, 'windSpeed': 13.16, 'apparentTemperature': 123.07, 'humidity': 0.41, 'dewPoint': 76.55, 'summary': 'Partly Cloudy', 'windBearing': 96, 'ozone': 271.69, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.28}, {'time': 1466321400, 'cloudCover': 0.69, 'temperature': 104.82, 'precipIntensity': 0.0029, 'precipProbability': 0.09, 'windSpeed': 12.91, 'apparentTemperature': 121.57, 'humidity': 0.41, 'dewPoint': 75.94, 'summary': 'Mostly Cloudy', 'windBearing': 96, 'ozone': 271.83, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 999.57}, {'time': 1466325000, 'cloudCover': 0.81, 'temperature': 103.83, 'precipIntensity': 0.003, 'precipProbability': 0.09, 'windSpeed': 12.55, 'apparentTemperature': 119.27, 'humidity': 0.41, 'dewPoint': 75.26, 'summary': 'Mostly Cloudy', 'windBearing': 95, 'ozone': 271.95, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 998.83}, {'time': 1466328600, 'cloudCover': 0.87, 'temperature': 103, 'precipIntensity': 0.003, 'precipProbability': 0.09, 'windSpeed': 12.07, 'apparentTemperature': 117.15, 'humidity': 0.41, 'dewPoint': 74.54, 'summary': 'Mostly Cloudy', 'windBearing': 93, 'ozone': 271.87, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 998.24}, {'time': 1466332200, 'cloudCover': 0.86, 'temperature': 102.28, 'precipIntensity': 0.003, 'precipProbability': 0.09, 'windSpeed': 11.45, 'apparentTemperature': 115.3, 'humidity': 0.41, 'dewPoint': 73.86, 'summary': 'Mostly Cloudy', 'windBearing': 89, 'ozone': 271.61, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 997.76}, {'time': 1466335800, 'cloudCover': 0.83, 'temperature': 101.5, 'precipIntensity': 0.0029, 'precipProbability': 0.09, 'windSpeed': 10.86, 'apparentTemperature': 113.58, 'humidity': 0.41, 'dewPoint': 73.31, 'summary': 'Mostly Cloudy', 'windBearing': 86, 'ozone': 271.29, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 997.52}, {'time': 1466339400, 'cloudCover': 0.83, 'temperature': 100.51, 'precipIntensity': 0.0028, 'precipProbability': 0.08, 'windSpeed': 10.41, 'apparentTemperature': 111.87, 'humidity': 0.42, 'dewPoint': 72.98, 'summary': 'Mostly Cloudy', 'windBearing': 85, 'ozone': 270.99, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 997.66}, {'time': 1466343000, 'cloudCover': 0.86, 'temperature': 99.32, 'precipIntensity': 0.0025, 'precipProbability': 0.07, 'windSpeed': 10.08, 'apparentTemperature': 110.21, 'humidity': 0.43, 'dewPoint': 72.88, 'summary': 'Mostly Cloudy', 'windBearing': 88, 'ozone': 270.66, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 998.23}, {'time': 1466346600, 'cloudCover': 0.88, 'temperature': 98.13, 'precipIntensity': 0.0022, 'precipProbability': 0.06, 'windSpeed': 9.77, 'apparentTemperature': 108.78, 'humidity': 0.45, 'dewPoint': 72.98, 'summary': 'Mostly Cloudy', 'windBearing': 91, 'ozone': 270.36, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 998.9}, {'time': 1466350200, 'cloudCover': 0.87, 'temperature': 97.09, 'precipIntensity': 0.0018, 'precipProbability': 0.04, 'windSpeed': 9.34, 'apparentTemperature': 107.69, 'humidity': 0.47, 'dewPoint': 73.2, 'summary': 'Mostly Cloudy', 'windBearing': 93, 'ozone': 270.16, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.33}, {'time': 1466353800, 'cloudCover': 0.83, 'temperature': 96.12, 'precipIntensity': 0.0014, 'precipProbability': 0.03, 'windSpeed': 8.82, 'apparentTemperature': 106.7, 'humidity': 0.48, 'dewPoint': 73.42, 'summary': 'Mostly Cloudy', 'windBearing': 95, 'ozone': 270.07, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.56}, {'time': 1466357400, 'cloudCover': 0.8, 'temperature': 95.22, 'precipIntensity': 0.0012, 'precipProbability': 0.02, 'windSpeed': 8.27, 'apparentTemperature': 105.82, 'humidity': 0.5, 'dewPoint': 73.66, 'summary': 'Mostly Cloudy', 'windBearing': 97, 'ozone': 269.98, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.68}, {'time': 1466361000, 'cloudCover': 0.77, 'temperature': 94.42, 'precipIntensity': 0.0009, 'precipProbability': 0.01, 'windSpeed': 7.77, 'apparentTemperature': 105.1, 'humidity': 0.52, 'dewPoint': 73.92, 'summary': 'Mostly Cloudy', 'windBearing': 101, 'ozone': 269.71, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.66}, {'time': 1466364600, 'cloudCover': 0.74, 'temperature': 93.62, 'precipIntensity': 0, 'precipProbability': 0, 'windSpeed': 7.31, 'apparentTemperature': 104.43, 'humidity': 0.54, 'dewPoint': 74.23, 'summary': 'Mostly Cloudy', 'windBearing': 106, 'ozone': 269.25, 'icon': 'partly-cloudy-night', 'pressure': 999.48}, {'time': 1466368200, 'cloudCover': 0.72, 'temperature': 92.76, 'precipIntensity': 0, 'precipProbability': 0, 'windSpeed': 6.93, 'apparentTemperature': 103.62, 'humidity': 0.56, 'dewPoint': 74.48, 'summary': 'Mostly Cloudy', 'windBearing': 112, 'ozone': 268.85, 'icon': 'partly-cloudy-night', 'pressure': 999.3}, {'time': 1466371800, 'cloudCover': 0.73, 'temperature': 91.74, 'precipIntensity': 0.0022, 'precipProbability': 0.06, 'windSpeed': 6.53, 'apparentTemperature': 102.47, 'humidity': 0.58, 'dewPoint': 74.63, 'summary': 'Mostly Cloudy', 'windBearing': 116, 'ozone': 268.76, 'icon': 'partly-cloudy-night', 'precipType': 'rain', 'pressure': 999.24}, {'time': 1466375400, 'cloudCover': 0.78, 'temperature': 90.45, 'precipIntensity': 0.0057, 'precipProbability': 0.23, 'windSpeed': 6.04, 'apparentTemperature': 100.83, 'humidity': 0.6, 'dewPoint': 74.69, 'summary': 'Drizzle', 'windBearing': 119, 'ozone': 268.96, 'icon': 'rain', 'precipType': 'rain', 'pressure': 999.32}, {'time': 1466379000, 'cloudCover': 0.83, 'temperature': 89.56, 'precipIntensity': 0.0087, 'precipProbability': 0.41, 'windSpeed': 5.66, 'apparentTemperature': 99.58, 'humidity': 0.62, 'dewPoint': 74.64, 'summary': 'Drizzle', 'windBearing': 122, 'ozone': 269.3, 'icon': 'rain', 'precipType': 'rain', 'pressure': 999.5}, {'time': 1466382600, 'cloudCover': 0.87, 'temperature': 90.34, 'precipIntensity': 0.0087, 'precipProbability': 0.41, 'windSpeed': 5.64, 'apparentTemperature': 101.07, 'humidity': 0.61, 'dewPoint': 75, 'summary': 'Drizzle', 'windBearing': 127, 'ozone': 269.68, 'icon': 'rain', 'precipType': 'rain', 'pressure': 999.72}, {'time': 1466386200, 'cloudCover': 0.91, 'temperature': 92.19, 'precipIntensity': 0.0058, 'precipProbability': 0.24, 'windSpeed': 6.03, 'apparentTemperature': 103.68, 'humidity': 0.58, 'dewPoint': 75.13, 'summary': 'Drizzle', 'windBearing': 135, 'ozone': 270.19, 'icon': 'rain', 'precipType': 'rain', 'pressure': 1000.07}]
In [18]:
print(miami_hourly['data'][0])
{'time': 1466213400, 'cloudCover': 0.56, 'temperature': 91.7, 'precipIntensity': 0.0023, 'precipProbability': 0.06, 'windSpeed': 7.18, 'apparentTemperature': 100.23, 'humidity': 0.54, 'dewPoint': 72.73, 'summary': 'Partly Cloudy', 'windBearing': 81, 'ozone': 278.36, 'icon': 'partly-cloudy-day', 'precipType': 'rain', 'pressure': 1000.81}
In [19]:
for hour in (miami_hourly['data']):
print("The weather is", hour['temperature'], "degrees")
if hour['cloudCover'] >= .5:
print("The weather is", hour['temperature'], "degrees and cloudy")
else:
print("The weather is", hour['temperature'], "degrees")
The weather is 91.7 degrees
The weather is 91.7 degrees and cloudy
The weather is 93.63 degrees
The weather is 93.63 degrees and cloudy
The weather is 95.06 degrees
The weather is 95.06 degrees and cloudy
The weather is 96.12 degrees
The weather is 96.12 degrees and cloudy
The weather is 97.06 degrees
The weather is 97.06 degrees and cloudy
The weather is 98.11 degrees
The weather is 98.11 degrees and cloudy
The weather is 99.32 degrees
The weather is 99.32 degrees and cloudy
The weather is 100.5 degrees
The weather is 100.5 degrees and cloudy
The weather is 101.38 degrees
The weather is 101.38 degrees and cloudy
The weather is 101.82 degrees
The weather is 101.82 degrees and cloudy
The weather is 101.26 degrees
The weather is 101.26 degrees and cloudy
The weather is 100.16 degrees
The weather is 100.16 degrees and cloudy
The weather is 98.57 degrees
The weather is 98.57 degrees and cloudy
The weather is 96.94 degrees
The weather is 96.94 degrees and cloudy
The weather is 95.69 degrees
The weather is 95.69 degrees and cloudy
The weather is 94.8 degrees
The weather is 94.8 degrees and cloudy
The weather is 94.11 degrees
The weather is 94.11 degrees and cloudy
The weather is 93.44 degrees
The weather is 93.44 degrees and cloudy
The weather is 92.69 degrees
The weather is 92.69 degrees and cloudy
The weather is 91.85 degrees
The weather is 91.85 degrees and cloudy
The weather is 90.83 degrees
The weather is 90.83 degrees and cloudy
The weather is 89.5 degrees
The weather is 89.5 degrees and cloudy
The weather is 88.61 degrees
The weather is 88.61 degrees and cloudy
The weather is 89.78 degrees
The weather is 89.78 degrees and cloudy
The weather is 91.75 degrees
The weather is 91.75 degrees and cloudy
The weather is 93.8 degrees
The weather is 93.8 degrees and cloudy
The weather is 96.02 degrees
The weather is 96.02 degrees
The weather is 99.38 degrees
The weather is 99.38 degrees
The weather is 103.06 degrees
The weather is 103.06 degrees and cloudy
The weather is 105.24 degrees
The weather is 105.24 degrees and cloudy
The weather is 104.82 degrees
The weather is 104.82 degrees and cloudy
The weather is 103.83 degrees
The weather is 103.83 degrees and cloudy
The weather is 103 degrees
The weather is 103 degrees and cloudy
The weather is 102.28 degrees
The weather is 102.28 degrees and cloudy
The weather is 101.5 degrees
The weather is 101.5 degrees and cloudy
The weather is 100.51 degrees
The weather is 100.51 degrees and cloudy
The weather is 99.32 degrees
The weather is 99.32 degrees and cloudy
The weather is 98.13 degrees
The weather is 98.13 degrees and cloudy
The weather is 97.09 degrees
The weather is 97.09 degrees and cloudy
The weather is 96.12 degrees
The weather is 96.12 degrees and cloudy
The weather is 95.22 degrees
The weather is 95.22 degrees and cloudy
The weather is 94.42 degrees
The weather is 94.42 degrees and cloudy
The weather is 93.62 degrees
The weather is 93.62 degrees and cloudy
The weather is 92.76 degrees
The weather is 92.76 degrees and cloudy
The weather is 91.74 degrees
The weather is 91.74 degrees and cloudy
The weather is 90.45 degrees
The weather is 90.45 degrees and cloudy
The weather is 89.56 degrees
The weather is 89.56 degrees and cloudy
The weather is 90.34 degrees
The weather is 90.34 degrees and cloudy
The weather is 92.19 degrees
The weather is 92.19 degrees and cloudy
In [20]:
response = requests.get('https://api.forecast.io/forecast/a69e446312b60b9982fba351359a544f/40.7829,73.9654,346593600')
print(response.text)
xmas_1980 = response.json()
print(xmas_1980.keys())
{"latitude":40.7829,"longitude":73.9654,"timezone":"Asia/Bishkek","offset":6,"currently":{"time":346593600,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipType":"rain","temperature":41,"apparentTemperature":41,"dewPoint":28.19,"humidity":0.6,"windSpeed":0.24,"windBearing":88,"visibility":6.56,"cloudCover":0.75},"hourly":{"summary":"Partly cloudy starting in the afternoon.","icon":"partly-cloudy-night","data":[{"time":346528800,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipType":"rain","temperature":32.33,"apparentTemperature":28.99,"dewPoint":23.35,"humidity":0.69,"windSpeed":3.54,"windBearing":82,"cloudCover":0.75},{"time":346532400,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipType":"snow","temperature":29.07,"apparentTemperature":29.07,"dewPoint":21.41,"humidity":0.73,"windSpeed":2.48,"windBearing":46,"cloudCover":0.54},{"time":346536000,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipType":"snow","temperature":25.25,"apparentTemperature":25.25,"dewPoint":19.26,"humidity":0.78,"windSpeed":1.78,"windBearing":355,"cloudCover":0.28},{"time":346539600,"summary":"Clear","icon":"clear-night","precipType":"snow","temperature":22.55,"apparentTemperature":22.55,"dewPoint":17.53,"humidity":0.81,"windSpeed":1.96,"windBearing":323,"cloudCover":0.1},{"time":346543200,"summary":"Clear","icon":"clear-night","precipType":"snow","temperature":22.01,"apparentTemperature":22.01,"dewPoint":16.71,"humidity":0.8,"windSpeed":1.29,"windBearing":333,"cloudCover":0.06},{"time":346546800,"summary":"Clear","icon":"clear-night","precipType":"snow","temperature":22.58,"apparentTemperature":22.58,"dewPoint":16.42,"humidity":0.77,"windSpeed":1,"windBearing":62,"cloudCover":0.09},{"time":346550400,"summary":"Clear","icon":"clear-night","precipType":"snow","temperature":22.88,"apparentTemperature":22.88,"dewPoint":16.16,"humidity":0.75,"windSpeed":2.02,"windBearing":82,"cloudCover":0.12},{"time":346554000,"summary":"Clear","icon":"clear-night","precipType":"snow","temperature":21.87,"apparentTemperature":21.87,"dewPoint":15.74,"humidity":0.77,"windSpeed":2.69,"windBearing":60,"visibility":7.03,"cloudCover":0.16},{"time":346557600,"summary":"Clear","icon":"clear-night","precipType":"snow","temperature":20.58,"apparentTemperature":15.28,"dewPoint":15.34,"humidity":0.8,"windSpeed":3.72,"windBearing":38,"visibility":7.03,"cloudCover":0.2},{"time":346561200,"summary":"Clear","icon":"clear-day","precipType":"snow","temperature":20.66,"apparentTemperature":14.98,"dewPoint":15.25,"humidity":0.79,"windSpeed":4,"windBearing":30,"visibility":7.03,"cloudCover":0.23},{"time":346564800,"summary":"Clear","icon":"clear-day","precipType":"snow","temperature":23.19,"apparentTemperature":23.19,"dewPoint":15.22,"humidity":0.71,"windSpeed":2.22,"windBearing":39,"visibility":8.02,"cloudCover":0.21},{"time":346568400,"summary":"Clear","icon":"clear-day","precipType":"snow","temperature":27.09,"apparentTemperature":27.09,"dewPoint":14.85,"humidity":0.59,"windSpeed":1.17,"windBearing":153,"visibility":9.01,"cloudCover":0.18},{"time":346572000,"summary":"Clear","icon":"clear-day","precipType":"snow","temperature":30.77,"apparentTemperature":30.77,"dewPoint":15.17,"humidity":0.52,"windSpeed":2.81,"windBearing":184,"visibility":10,"cloudCover":0.18},{"time":346575600,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipType":"rain","temperature":33.85,"apparentTemperature":33.85,"dewPoint":18.33,"humidity":0.52,"windSpeed":2.5,"windBearing":197,"visibility":9.89,"cloudCover":0.25},{"time":346579200,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipType":"rain","temperature":36.71,"apparentTemperature":36.71,"dewPoint":23.01,"humidity":0.57,"windSpeed":1.47,"windBearing":229,"visibility":9.29,"cloudCover":0.34},{"time":346582800,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipType":"rain","temperature":38.9,"apparentTemperature":38.9,"dewPoint":26.54,"humidity":0.61,"windSpeed":1.22,"windBearing":275,"visibility":8.61,"cloudCover":0.44},{"time":346586400,"summary":"Partly Cloudy","icon":"partly-cloudy-day","precipType":"rain","temperature":40.57,"apparentTemperature":40.57,"dewPoint":27.95,"humidity":0.6,"windSpeed":0.95,"windBearing":296,"visibility":7.93,"cloudCover":0.57},{"time":346590000,"summary":"Mostly Cloudy","icon":"partly-cloudy-day","precipType":"rain","temperature":41.58,"apparentTemperature":41.58,"dewPoint":28.27,"humidity":0.59,"windSpeed":0.43,"windBearing":330,"visibility":7.24,"cloudCover":0.69},{"time":346593600,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipType":"rain","temperature":41,"apparentTemperature":41,"dewPoint":28.19,"humidity":0.6,"windSpeed":0.24,"windBearing":88,"visibility":6.56,"cloudCover":0.75},{"time":346597200,"summary":"Mostly Cloudy","icon":"partly-cloudy-night","precipType":"rain","temperature":37.76,"apparentTemperature":37.76,"dewPoint":27.76,"humidity":0.67,"windSpeed":1.02,"windBearing":167,"visibility":6.56,"cloudCover":0.68},{"time":346600800,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipType":"rain","temperature":32.93,"apparentTemperature":32.93,"dewPoint":26.34,"humidity":0.76,"windSpeed":2.33,"windBearing":179,"visibility":6.56,"cloudCover":0.54},{"time":346604400,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipType":"snow","temperature":28.81,"apparentTemperature":25.63,"dewPoint":24.36,"humidity":0.83,"windSpeed":3.05,"windBearing":180,"cloudCover":0.43},{"time":346608000,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipType":"snow","temperature":26.25,"apparentTemperature":26.25,"dewPoint":22.19,"humidity":0.84,"windSpeed":2.51,"windBearing":171,"cloudCover":0.39},{"time":346611600,"summary":"Partly Cloudy","icon":"partly-cloudy-night","precipType":"snow","temperature":24.39,"apparentTemperature":24.39,"dewPoint":19.91,"humidity":0.83,"windSpeed":1.59,"windBearing":145,"cloudCover":0.38}]},"daily":{"data":[{"time":346528800,"summary":"Partly cloudy starting in the afternoon.","icon":"partly-cloudy-night","sunriseTime":346559286,"sunsetTime":346592593,"moonPhase":0.62,"precipType":"snow","temperatureMin":20.58,"temperatureMinTime":346557600,"temperatureMax":41.58,"temperatureMaxTime":346590000,"apparentTemperatureMin":14.98,"apparentTemperatureMinTime":346561200,"apparentTemperatureMax":41.58,"apparentTemperatureMaxTime":346590000,"dewPoint":20.64,"humidity":0.71,"windSpeed":0.51,"windBearing":88,"visibility":7.91,"cloudCover":0.36}]},"flags":{"sources":["isd"],"isd-stations":["386130-99999","386150-99999","386270-99999","387450-99999","517010-99999"],"units":"us"}}
dict_keys(['daily', 'latitude', 'timezone', 'flags', 'currently', 'offset', 'hourly', 'longitude'])
In [21]:
print(xmas_1980['currently']['temperature'])
41
In [22]:
response = requests.get('https://api.forecast.io/forecast/a69e446312b60b9982fba351359a544f/40.7829,73.9654,662126400')
xmas_1990 = response.json()
print(xmas_1990['currently']['temperature'])
32.08
In [23]:
response = requests.get('https://api.forecast.io/forecast/a69e446312b60b9982fba351359a544f/40.7829,73.9654,977745600')
xmas_2000 = response.json()
print(xmas_2000['currently']['temperature'])
33.79
In [ ]:
Content source: kbennion/foundations-hw
Similar notebooks: