In [ ]:
Make a request from the Forecast.io API for where you were born (or lived, or want to visit!)
In [7]:
import requests
In [8]:
!pip3 install requests
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/local/lib/python3.5/site-packages
In [12]:
#new york
response = requests.get("https://api.forecast.io/forecast/94bc3fa3628bfad686b10e7054c67f71/40.7141667, -74.0063889")
In [13]:
data = response.json()
In [14]:
print(data)
{'hourly': {'icon': 'rain', 'data': [{'icon': 'partly-cloudy-day', 'humidity': 0.56, 'summary': 'Partly Cloudy', 'dewPoint': 65.48, 'precipIntensity': 0.0035, 'cloudCover': 0.29, 'time': 1465671600, 'visibility': 9.55, 'temperature': 83, 'apparentTemperature': 84.98, 'precipType': 'rain', 'ozone': 317.78, 'precipProbability': 0.12, 'windBearing': 240, 'windSpeed': 5.05, 'pressure': 1008.87}, {'icon': 'partly-cloudy-day', 'humidity': 0.55, 'summary': 'Partly Cloudy', 'dewPoint': 66.48, 'precipIntensity': 0.0013, 'cloudCover': 0.36, 'time': 1465675200, 'visibility': 9.57, 'temperature': 84.59, 'apparentTemperature': 87.07, 'precipType': 'rain', 'ozone': 318.89, 'precipProbability': 0.04, 'windBearing': 240, 'windSpeed': 7.22, 'pressure': 1007.93}, {'icon': 'rain', 'humidity': 0.57, 'summary': 'Light Rain', 'dewPoint': 66.69, 'precipIntensity': 0.0442, 'cloudCover': 0.42, 'time': 1465678800, 'visibility': 9.52, 'temperature': 83.72, 'apparentTemperature': 86.25, 'precipType': 'rain', 'ozone': 320.64, 'precipProbability': 0.66, 'windBearing': 240, 'windSpeed': 8.19, 'pressure': 1007.15}, {'icon': 'rain', 'humidity': 0.59, 'summary': 'Light Rain', 'dewPoint': 67.71, 'precipIntensity': 0.0163, 'cloudCover': 0.47, 'time': 1465682400, 'visibility': 9.47, 'temperature': 83.35, 'apparentTemperature': 86.33, 'precipType': 'rain', 'ozone': 323.69, 'precipProbability': 0.52, 'windBearing': 238, 'windSpeed': 7.71, 'pressure': 1006.54}, {'icon': 'rain', 'humidity': 0.62, 'summary': 'Rain', 'dewPoint': 68.46, 'precipIntensity': 0.0542, 'cloudCover': 0.41, 'time': 1465686000, 'visibility': 9.49, 'temperature': 82.65, 'apparentTemperature': 85.9, 'precipType': 'rain', 'ozone': 327.38, 'precipProbability': 0.65, 'windBearing': 242, 'windSpeed': 8.11, 'pressure': 1006.13}, {'icon': 'rain', 'humidity': 0.65, 'summary': 'Light Rain', 'dewPoint': 68.7, 'precipIntensity': 0.0151, 'cloudCover': 0.3, 'time': 1465689600, 'visibility': 9.53, 'temperature': 81.56, 'apparentTemperature': 84.71, 'precipType': 'rain', 'ozone': 329.47, 'precipProbability': 0.51, 'windBearing': 242, 'windSpeed': 7.24, 'pressure': 1006.01}, {'icon': 'rain', 'humidity': 0.68, 'summary': 'Drizzle', 'dewPoint': 67.26, 'precipIntensity': 0.0066, 'cloudCover': 0.29, 'time': 1465693200, 'visibility': 9.25, 'temperature': 78.51, 'apparentTemperature': 78.51, 'precipType': 'rain', 'ozone': 328.7, 'precipProbability': 0.29, 'windBearing': 249, 'windSpeed': 6.08, 'pressure': 1006.07}, {'icon': 'rain', 'humidity': 0.72, 'summary': 'Drizzle', 'dewPoint': 67.38, 'precipIntensity': 0.0053, 'cloudCover': 0.22, 'time': 1465696800, 'visibility': 8.95, 'temperature': 77.01, 'apparentTemperature': 77.01, 'precipType': 'rain', 'ozone': 326.31, 'precipProbability': 0.22, 'windBearing': 258, 'windSpeed': 5.94, 'pressure': 1006.33}, {'icon': 'clear-night', 'humidity': 0.74, 'summary': 'Clear', 'dewPoint': 67.26, 'precipIntensity': 0, 'cloudCover': 0.17, 'time': 1465700400, 'temperature': 76.09, 'apparentTemperature': 76.09, 'visibility': 9.2, 'ozone': 323.83, 'precipProbability': 0, 'windBearing': 261, 'windSpeed': 5.86, 'pressure': 1006.52}, {'icon': 'clear-night', 'humidity': 0.76, 'summary': 'Clear', 'dewPoint': 66.66, 'precipIntensity': 0, 'cloudCover': 0.17, 'time': 1465704000, 'temperature': 74.86, 'apparentTemperature': 74.86, 'visibility': 9.29, 'ozone': 321.55, 'precipProbability': 0, 'windBearing': 256, 'windSpeed': 6.04, 'pressure': 1006.51}, {'icon': 'clear-night', 'humidity': 0.76, 'summary': 'Clear', 'dewPoint': 65.86, 'precipIntensity': 0, 'cloudCover': 0.12, 'time': 1465707600, 'temperature': 73.84, 'apparentTemperature': 73.84, 'visibility': 9.31, 'ozone': 319.16, 'precipProbability': 0, 'windBearing': 252, 'windSpeed': 5.49, 'pressure': 1006.37}, {'icon': 'clear-night', 'humidity': 0.77, 'summary': 'Clear', 'dewPoint': 65.31, 'precipIntensity': 0, 'cloudCover': 0.13, 'time': 1465711200, 'temperature': 72.82, 'apparentTemperature': 72.82, 'visibility': 9.32, 'ozone': 317.29, 'precipProbability': 0, 'windBearing': 249, 'windSpeed': 5.72, 'pressure': 1006.05}, {'icon': 'clear-night', 'humidity': 0.78, 'summary': 'Clear', 'dewPoint': 64.63, 'precipIntensity': 0, 'cloudCover': 0.09, 'time': 1465714800, 'temperature': 72, 'apparentTemperature': 72, 'visibility': 9.41, 'ozone': 316.29, 'precipProbability': 0, 'windBearing': 245, 'windSpeed': 6.13, 'pressure': 1005.45}, {'icon': 'clear-night', 'humidity': 0.79, 'summary': 'Clear', 'dewPoint': 64.34, 'precipIntensity': 0, 'cloudCover': 0.07, 'time': 1465718400, 'temperature': 71.27, 'apparentTemperature': 71.27, 'visibility': 9.45, 'ozone': 315.8, 'precipProbability': 0, 'windBearing': 232, 'windSpeed': 6.29, 'pressure': 1004.8}, {'icon': 'rain', 'humidity': 0.79, 'summary': 'Light Rain', 'dewPoint': 64.06, 'precipIntensity': 0.015, 'cloudCover': 0.08, 'time': 1465722000, 'visibility': 9.46, 'temperature': 70.84, 'apparentTemperature': 70.84, 'precipType': 'rain', 'ozone': 315.3, 'precipProbability': 0.51, 'windBearing': 234, 'windSpeed': 6.79, 'pressure': 1004.29}, {'icon': 'clear-day', 'humidity': 0.79, 'summary': 'Clear', 'dewPoint': 64.6, 'precipIntensity': 0.0012, 'cloudCover': 0.07, 'time': 1465725600, 'visibility': 9.39, 'temperature': 71.36, 'apparentTemperature': 71.36, 'precipType': 'rain', 'ozone': 314.25, 'precipProbability': 0.02, 'windBearing': 250, 'windSpeed': 7.5, 'pressure': 1004.04}, {'icon': 'clear-day', 'humidity': 0.74, 'summary': 'Clear', 'dewPoint': 64.77, 'precipIntensity': 0, 'cloudCover': 0.07, 'time': 1465729200, 'temperature': 73.45, 'apparentTemperature': 73.45, 'visibility': 9.9, 'ozone': 313.2, 'precipProbability': 0, 'windBearing': 271, 'windSpeed': 8.77, 'pressure': 1003.95}, {'icon': 'clear-day', 'humidity': 0.67, 'summary': 'Clear', 'dewPoint': 63.87, 'precipIntensity': 0, 'cloudCover': 0.08, 'time': 1465732800, 'temperature': 75.54, 'apparentTemperature': 75.54, 'visibility': 10, 'ozone': 313.27, 'precipProbability': 0, 'windBearing': 277, 'windSpeed': 11.21, 'pressure': 1003.97}, {'icon': 'clear-day', 'humidity': 0.63, 'summary': 'Clear', 'dewPoint': 62.68, 'precipIntensity': 0, 'cloudCover': 0.1, 'time': 1465736400, 'temperature': 76.11, 'apparentTemperature': 76.11, 'visibility': 10, 'ozone': 314.93, 'precipProbability': 0, 'windBearing': 280, 'windSpeed': 12.1, 'pressure': 1004.15}, {'icon': 'clear-day', 'humidity': 0.57, 'summary': 'Clear', 'dewPoint': 60.29, 'precipIntensity': 0, 'cloudCover': 0.1, 'time': 1465740000, 'temperature': 76.67, 'apparentTemperature': 76.67, 'visibility': 10, 'ozone': 317.71, 'precipProbability': 0, 'windBearing': 282, 'windSpeed': 13.53, 'pressure': 1004.46}, {'icon': 'clear-day', 'humidity': 0.51, 'summary': 'Clear', 'dewPoint': 57.62, 'precipIntensity': 0, 'cloudCover': 0.13, 'time': 1465743600, 'temperature': 77.28, 'apparentTemperature': 77.28, 'visibility': 10, 'ozone': 321.36, 'precipProbability': 0, 'windBearing': 284, 'windSpeed': 14.61, 'pressure': 1004.65}, {'icon': 'clear-day', 'humidity': 0.46, 'summary': 'Clear', 'dewPoint': 55.73, 'precipIntensity': 0, 'cloudCover': 0.15, 'time': 1465747200, 'temperature': 78.19, 'apparentTemperature': 78.19, 'visibility': 10, 'ozone': 325.89, 'precipProbability': 0, 'windBearing': 288, 'windSpeed': 15.13, 'pressure': 1004.67}, {'icon': 'clear-day', 'humidity': 0.43, 'summary': 'Clear', 'dewPoint': 54.07, 'precipIntensity': 0, 'cloudCover': 0.16, 'time': 1465750800, 'temperature': 78.39, 'apparentTemperature': 78.39, 'visibility': 10, 'ozone': 331.29, 'precipProbability': 0, 'windBearing': 289, 'windSpeed': 16.49, 'pressure': 1004.59}, {'icon': 'clear-day', 'humidity': 0.41, 'summary': 'Clear', 'dewPoint': 51.79, 'precipIntensity': 0, 'cloudCover': 0.12, 'time': 1465754400, 'temperature': 77.37, 'apparentTemperature': 77.37, 'visibility': 10, 'ozone': 337.27, 'precipProbability': 0, 'windBearing': 291, 'windSpeed': 17.22, 'pressure': 1004.58}, {'icon': 'clear-day', 'humidity': 0.41, 'summary': 'Clear', 'dewPoint': 50.49, 'precipIntensity': 0, 'cloudCover': 0.06, 'time': 1465758000, 'temperature': 75.78, 'apparentTemperature': 75.78, 'visibility': 10, 'ozone': 345, 'precipProbability': 0, 'windBearing': 289, 'windSpeed': 17.35, 'pressure': 1004.59}, {'icon': 'clear-day', 'humidity': 0.42, 'summary': 'Clear', 'dewPoint': 49.86, 'precipIntensity': 0, 'cloudCover': 0.03, 'time': 1465761600, 'temperature': 74.66, 'apparentTemperature': 74.66, 'visibility': 10, 'ozone': 353.3, 'precipProbability': 0, 'windBearing': 291, 'windSpeed': 17.33, 'pressure': 1004.65}, {'icon': 'clear-day', 'humidity': 0.43, 'summary': 'Clear', 'dewPoint': 49.56, 'precipIntensity': 0, 'cloudCover': 0.02, 'time': 1465765200, 'temperature': 73.39, 'apparentTemperature': 73.39, 'visibility': 10, 'ozone': 358.42, 'precipProbability': 0, 'windBearing': 293, 'windSpeed': 17.42, 'pressure': 1004.92}, {'icon': 'clear-day', 'humidity': 0.45, 'summary': 'Clear', 'dewPoint': 49.47, 'precipIntensity': 0, 'cloudCover': 0.04, 'time': 1465768800, 'temperature': 71.74, 'apparentTemperature': 71.74, 'visibility': 10, 'ozone': 357.61, 'precipProbability': 0, 'windBearing': 295, 'windSpeed': 17.66, 'pressure': 1005.5}, {'icon': 'clear-day', 'humidity': 0.48, 'summary': 'Clear', 'dewPoint': 49.49, 'precipIntensity': 0, 'cloudCover': 0.08, 'time': 1465772400, 'temperature': 69.83, 'apparentTemperature': 69.83, 'visibility': 10, 'ozone': 353.6, 'precipProbability': 0, 'windBearing': 297, 'windSpeed': 17.79, 'pressure': 1006.26}, {'icon': 'clear-day', 'humidity': 0.52, 'summary': 'Clear', 'dewPoint': 49.31, 'precipIntensity': 0, 'cloudCover': 0.09, 'time': 1465776000, 'temperature': 67.81, 'apparentTemperature': 67.81, 'visibility': 10, 'ozone': 350.8, 'precipProbability': 0, 'windBearing': 299, 'windSpeed': 17.66, 'pressure': 1006.84}, {'icon': 'clear-night', 'humidity': 0.54, 'summary': 'Clear', 'dewPoint': 48.56, 'precipIntensity': 0, 'cloudCover': 0.07, 'time': 1465779600, 'temperature': 65.57, 'apparentTemperature': 65.57, 'visibility': 10, 'ozone': 351.01, 'precipProbability': 0, 'windBearing': 299, 'windSpeed': 17.42, 'pressure': 1007.35}, {'icon': 'clear-night', 'humidity': 0.57, 'summary': 'Clear', 'dewPoint': 47.58, 'precipIntensity': 0, 'cloudCover': 0.03, 'time': 1465783200, 'temperature': 63.21, 'apparentTemperature': 63.21, 'visibility': 10, 'ozone': 352.42, 'precipProbability': 0, 'windBearing': 299, 'windSpeed': 17.02, 'pressure': 1007.81}, {'icon': 'clear-night', 'humidity': 0.59, 'summary': 'Clear', 'dewPoint': 46.8, 'precipIntensity': 0, 'cloudCover': 0, 'time': 1465786800, 'temperature': 61.29, 'apparentTemperature': 61.29, 'visibility': 10, 'ozone': 354.04, 'precipProbability': 0, 'windBearing': 299, 'windSpeed': 16.51, 'pressure': 1008.16}, {'icon': 'clear-night', 'humidity': 0.61, 'summary': 'Clear', 'dewPoint': 46.58, 'precipIntensity': 0, 'cloudCover': 0, 'time': 1465790400, 'temperature': 60.24, 'apparentTemperature': 60.24, 'visibility': 10, 'ozone': 356.09, 'precipProbability': 0, 'windBearing': 300, 'windSpeed': 15.96, 'pressure': 1008.27}, {'icon': 'clear-night', 'humidity': 0.62, 'summary': 'Clear', 'dewPoint': 46.57, 'precipIntensity': 0, 'cloudCover': 0, 'time': 1465794000, 'temperature': 59.6, 'apparentTemperature': 59.6, 'visibility': 10, 'ozone': 358.34, 'precipProbability': 0, 'windBearing': 302, 'windSpeed': 15.44, 'pressure': 1008.28}, {'icon': 'clear-night', 'humidity': 0.63, 'summary': 'Clear', 'dewPoint': 46.3, 'precipIntensity': 0, 'cloudCover': 0, 'time': 1465797600, 'temperature': 58.74, 'apparentTemperature': 58.74, 'visibility': 10, 'ozone': 359.11, 'precipProbability': 0, 'windBearing': 304, 'windSpeed': 14.94, 'pressure': 1008.35}, {'icon': 'clear-night', 'humidity': 0.65, 'summary': 'Clear', 'dewPoint': 45.88, 'precipIntensity': 0, 'cloudCover': 0, 'time': 1465801200, 'temperature': 57.61, 'apparentTemperature': 57.61, 'visibility': 10, 'ozone': 357.4, 'precipProbability': 0, 'windBearing': 301, 'windSpeed': 14.63, 'pressure': 1008.5}, {'icon': 'clear-night', 'humidity': 0.66, 'summary': 'Clear', 'dewPoint': 45.79, 'precipIntensity': 0, 'cloudCover': 0.01, 'time': 1465804800, 'temperature': 56.88, 'apparentTemperature': 56.88, 'visibility': 10, 'ozone': 354.22, 'precipProbability': 0, 'windBearing': 297, 'windSpeed': 14.53, 'pressure': 1008.7}, {'icon': 'clear-night', 'humidity': 0.67, 'summary': 'Clear', 'dewPoint': 46.38, 'precipIntensity': 0, 'cloudCover': 0.02, 'time': 1465808400, 'temperature': 57.25, 'apparentTemperature': 57.25, 'visibility': 10, 'ozone': 350.93, 'precipProbability': 0, 'windBearing': 295, 'windSpeed': 14.35, 'pressure': 1008.94}, {'icon': 'clear-day', 'humidity': 0.66, 'summary': 'Clear', 'dewPoint': 47.07, 'precipIntensity': 0, 'cloudCover': 0.03, 'time': 1465812000, 'temperature': 58.25, 'apparentTemperature': 58.25, 'visibility': 10, 'ozone': 347.83, 'precipProbability': 0, 'windBearing': 295, 'windSpeed': 14.71, 'pressure': 1009.27}, {'icon': 'clear-day', 'humidity': 0.65, 'summary': 'Clear', 'dewPoint': 47.89, 'precipIntensity': 0, 'cloudCover': 0.04, 'time': 1465815600, 'temperature': 59.8, 'apparentTemperature': 59.8, 'visibility': 10, 'ozone': 344.63, 'precipProbability': 0, 'windBearing': 295, 'windSpeed': 15.29, 'pressure': 1009.64}, {'icon': 'clear-day', 'humidity': 0.63, 'summary': 'Clear', 'dewPoint': 48.46, 'precipIntensity': 0, 'cloudCover': 0.06, 'time': 1465819200, 'temperature': 61.32, 'apparentTemperature': 61.32, 'visibility': 10, 'ozone': 341.81, 'precipProbability': 0, 'windBearing': 296, 'windSpeed': 15.56, 'pressure': 1009.88}, {'icon': 'clear-day', 'humidity': 0.6, 'summary': 'Clear', 'dewPoint': 49.03, 'precipIntensity': 0, 'cloudCover': 0.07, 'time': 1465822800, 'temperature': 63.2, 'apparentTemperature': 63.2, 'visibility': 10, 'ozone': 339.74, 'precipProbability': 0, 'windBearing': 298, 'windSpeed': 15.45, 'pressure': 1009.95}, {'icon': 'clear-day', 'humidity': 0.57, 'summary': 'Clear', 'dewPoint': 49.61, 'precipIntensity': 0, 'cloudCover': 0.08, 'time': 1465826400, 'temperature': 65.41, 'apparentTemperature': 65.41, 'visibility': 10, 'ozone': 338.05, 'precipProbability': 0, 'windBearing': 301, 'windSpeed': 15.19, 'pressure': 1009.91}, {'icon': 'clear-day', 'humidity': 0.54, 'summary': 'Clear', 'dewPoint': 50.09, 'precipIntensity': 0, 'cloudCover': 0.11, 'time': 1465830000, 'temperature': 67.52, 'apparentTemperature': 67.52, 'visibility': 10, 'ozone': 336.17, 'precipProbability': 0, 'windBearing': 302, 'windSpeed': 14.97, 'pressure': 1009.76}, {'icon': 'clear-day', 'humidity': 0.51, 'summary': 'Clear', 'dewPoint': 50.61, 'precipIntensity': 0, 'cloudCover': 0.15, 'time': 1465833600, 'temperature': 69.56, 'apparentTemperature': 69.56, 'visibility': 10, 'ozone': 334.06, 'precipProbability': 0, 'windBearing': 300, 'windSpeed': 14.43, 'pressure': 1009.47}, {'icon': 'clear-day', 'humidity': 0.49, 'summary': 'Clear', 'dewPoint': 51.28, 'precipIntensity': 0, 'cloudCover': 0.19, 'time': 1465837200, 'temperature': 71.68, 'apparentTemperature': 71.68, 'visibility': 10, 'ozone': 331.76, 'precipProbability': 0, 'windBearing': 296, 'windSpeed': 13.83, 'pressure': 1009.08}, {'icon': 'partly-cloudy-day', 'humidity': 0.47, 'summary': 'Partly Cloudy', 'dewPoint': 52, 'precipIntensity': 0, 'cloudCover': 0.28, 'time': 1465840800, 'temperature': 73.62, 'apparentTemperature': 73.62, 'visibility': 10, 'ozone': 328.84, 'precipProbability': 0, 'windBearing': 293, 'windSpeed': 13.48, 'pressure': 1008.7}, {'icon': 'partly-cloudy-day', 'humidity': 0.46, 'summary': 'Partly Cloudy', 'dewPoint': 52.68, 'precipIntensity': 0, 'cloudCover': 0.44, 'time': 1465844400, 'temperature': 75.18, 'apparentTemperature': 75.18, 'visibility': 10, 'ozone': 324.73, 'precipProbability': 0, 'windBearing': 292, 'windSpeed': 13.04, 'pressure': 1008.28}], 'summary': 'Rain starting this evening.'}, 'minutely': {'icon': 'partly-cloudy-day', 'data': [{'time': 1465674180, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674240, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674300, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674360, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674420, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674480, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674540, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674600, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674660, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674720, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674780, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674840, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674900, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465674960, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675020, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675080, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675140, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675200, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675260, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675320, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675380, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675440, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675500, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675560, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675620, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675680, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675740, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675800, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675860, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675920, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465675980, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676040, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676100, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676160, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676220, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676280, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676340, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676400, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676460, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676520, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676580, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676640, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676700, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676760, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676820, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676880, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465676940, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677000, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677060, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677120, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677180, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677240, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677300, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677360, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677420, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677480, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677540, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677600, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677660, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677720, 'precipIntensity': 0, 'precipProbability': 0}, {'time': 1465677780, 'precipIntensity': 0, 'precipProbability': 0}], 'summary': 'Partly cloudy for the hour.'}, 'currently': {'icon': 'partly-cloudy-day', 'humidity': 0.55, 'summary': 'Partly Cloudy', 'dewPoint': 66.2, 'nearestStormDistance': 23, 'precipIntensity': 0, 'cloudCover': 0.34, 'time': 1465674190, 'nearestStormBearing': 225, 'temperature': 84.14, 'apparentTemperature': 86.47, 'visibility': 9.57, 'ozone': 318.57, 'precipProbability': 0, 'windBearing': 240, 'windSpeed': 6.61, 'pressure': 1008.19}, 'flags': {'sources': ['darksky', 'lamp', 'gfs', 'cmc', 'nam', 'rap', 'rtma', 'sref', 'fnmoc', 'isd', 'nwspa', 'madis', 'nearest-precip'], 'isd-stations': ['725033-94728', '725060-94728', '725060-99999', '997271-99999', '999999-94706'], 'units': 'us', 'darksky-stations': ['KDIX'], 'lamp-stations': ['KBLM', 'KCDW', 'KEWR', 'KFRG', 'KHPN', 'KJFK', 'KLGA', 'KMMU', 'KNYC', 'KSMQ', 'KTEB'], 'madis-stations': ['AU015', 'BATN6', 'C1099', 'C9714', 'D0486', 'D3216', 'D6004', 'D9152', 'E0405', 'E1296', 'E2876', 'KNYC', 'KTEB', 'NJ12', 'NJ65', 'ROBN4']}, 'latitude': 40.7141667, 'daily': {'icon': 'rain', 'data': [{'precipType': 'rain', 'precipIntensity': 0.0063, 'cloudCover': 0.29, 'temperatureMaxTime': 1465675200, 'precipIntensityMaxTime': 1465686000, 'icon': 'rain', 'apparentTemperatureMin': 56.36, 'precipIntensityMax': 0.0542, 'sunriseTime': 1465637144, 'apparentTemperatureMinTime': 1465635600, 'apparentTemperatureMax': 87.07, 'summary': 'Rain starting in the evening.', 'windBearing': 226, 'time': 1465617600, 'humidity': 0.61, 'precipProbability': 0.66, 'dewPoint': 57.21, 'temperatureMinTime': 1465635600, 'apparentTemperatureMaxTime': 1465675200, 'temperatureMax': 84.59, 'sunsetTime': 1465691315, 'temperatureMin': 56.36, 'visibility': 9.7, 'ozone': 329.2, 'windSpeed': 4.06, 'moonPhase': 0.23, 'pressure': 1012.07}, {'precipType': 'rain', 'precipIntensity': 0.0007, 'cloudCover': 0.09, 'temperatureMaxTime': 1465750800, 'precipIntensityMaxTime': 1465722000, 'icon': 'clear-day', 'apparentTemperatureMin': 61.29, 'precipIntensityMax': 0.015, 'sunriseTime': 1465723540, 'apparentTemperatureMinTime': 1465786800, 'apparentTemperatureMax': 78.39, 'summary': 'Clear throughout the day.', 'windBearing': 285, 'time': 1465704000, 'humidity': 0.59, 'precipProbability': 0.51, 'dewPoint': 56.97, 'temperatureMinTime': 1465786800, 'apparentTemperatureMaxTime': 1465750800, 'temperatureMax': 78.39, 'sunsetTime': 1465777744, 'temperatureMin': 61.29, 'visibility': 9.81, 'ozone': 332.11, 'windSpeed': 12.3, 'moonPhase': 0.26, 'pressure': 1005.36}, {'precipIntensity': 0, 'cloudCover': 0.34, 'temperatureMaxTime': 1465851600, 'icon': 'partly-cloudy-night', 'apparentTemperatureMin': 56.88, 'precipIntensityMax': 0, 'sunriseTime': 1465809937, 'apparentTemperatureMinTime': 1465804800, 'apparentTemperatureMax': 77.11, 'summary': 'Mostly cloudy starting in the afternoon.', 'windBearing': 297, 'sunsetTime': 1465864170, 'humidity': 0.55, 'precipProbability': 0, 'dewPoint': 49.53, 'temperatureMinTime': 1465804800, 'time': 1465790400, 'temperatureMax': 77.11, 'apparentTemperatureMaxTime': 1465851600, 'temperatureMin': 56.88, 'visibility': 10, 'ozone': 333.06, 'windSpeed': 13.98, 'moonPhase': 0.29, 'pressure': 1008.87}, {'precipIntensity': 0, 'cloudCover': 0.4, 'temperatureMaxTime': 1465938000, 'icon': 'partly-cloudy-day', 'apparentTemperatureMin': 60.12, 'precipIntensityMax': 0, 'sunriseTime': 1465896336, 'apparentTemperatureMinTime': 1465898400, 'apparentTemperatureMax': 77.97, 'summary': 'Partly cloudy throughout the day.', 'windBearing': 288, 'sunsetTime': 1465950595, 'humidity': 0.5, 'precipProbability': 0, 'dewPoint': 49.07, 'temperatureMinTime': 1465898400, 'time': 1465876800, 'temperatureMax': 77.97, 'apparentTemperatureMaxTime': 1465938000, 'temperatureMin': 60.12, 'visibility': 10, 'ozone': 308.72, 'windSpeed': 7.09, 'moonPhase': 0.32, 'pressure': 1011.9}, {'precipType': 'rain', 'precipIntensity': 0.0017, 'cloudCover': 0.4, 'temperatureMaxTime': 1466024400, 'precipIntensityMaxTime': 1465995600, 'icon': 'partly-cloudy-day', 'apparentTemperatureMin': 64.38, 'precipIntensityMax': 0.0024, 'sunriseTime': 1465982737, 'apparentTemperatureMinTime': 1465984800, 'apparentTemperatureMax': 73.48, 'summary': 'Mostly cloudy throughout the day.', 'windBearing': 239, 'time': 1465963200, 'humidity': 0.71, 'precipProbability': 0.07, 'dewPoint': 58.7, 'temperatureMinTime': 1465984800, 'apparentTemperatureMaxTime': 1466024400, 'temperatureMax': 73.48, 'sunsetTime': 1466037018, 'temperatureMin': 64.38, 'ozone': 302.91, 'windSpeed': 2.4, 'moonPhase': 0.35, 'pressure': 1014.34}, {'precipType': 'rain', 'precipIntensity': 0.0026, 'cloudCover': 0.83, 'temperatureMaxTime': 1466110800, 'precipIntensityMaxTime': 1466103600, 'icon': 'partly-cloudy-day', 'apparentTemperatureMin': 66.28, 'precipIntensityMax': 0.0036, 'sunriseTime': 1466069139, 'apparentTemperatureMinTime': 1466074800, 'apparentTemperatureMax': 71.61, 'summary': 'Mostly cloudy throughout the day.', 'windBearing': 159, 'time': 1466049600, 'humidity': 0.71, 'precipProbability': 0.12, 'dewPoint': 58.67, 'temperatureMinTime': 1466074800, 'apparentTemperatureMaxTime': 1466110800, 'temperatureMax': 71.61, 'sunsetTime': 1466123440, 'temperatureMin': 66.28, 'ozone': 298.64, 'windSpeed': 1.42, 'moonPhase': 0.38, 'pressure': 1012.49}, {'precipType': 'rain', 'precipIntensity': 0.001, 'cloudCover': 0.72, 'temperatureMaxTime': 1466186400, 'precipIntensityMaxTime': 1466136000, 'icon': 'partly-cloudy-day', 'apparentTemperatureMin': 65.16, 'precipIntensityMax': 0.0017, 'sunriseTime': 1466155544, 'apparentTemperatureMinTime': 1466161200, 'apparentTemperatureMax': 71.89, 'summary': 'Mostly cloudy throughout the day.', 'windBearing': 93, 'time': 1466136000, 'humidity': 0.68, 'precipProbability': 0.04, 'dewPoint': 57.12, 'temperatureMinTime': 1466161200, 'apparentTemperatureMaxTime': 1466186400, 'temperatureMax': 71.89, 'sunsetTime': 1466209859, 'temperatureMin': 65.16, 'ozone': 317.52, 'windSpeed': 3.93, 'moonPhase': 0.41, 'pressure': 1016.18}, {'precipIntensity': 0, 'cloudCover': 0.01, 'temperatureMaxTime': 1466280000, 'icon': 'clear-day', 'apparentTemperatureMin': 65.31, 'precipIntensityMax': 0, 'sunriseTime': 1466241951, 'apparentTemperatureMinTime': 1466247600, 'apparentTemperatureMax': 73.22, 'summary': 'Clear throughout the day.', 'windBearing': 194, 'sunsetTime': 1466296277, 'humidity': 0.63, 'precipProbability': 0, 'dewPoint': 55.54, 'temperatureMinTime': 1466247600, 'time': 1466222400, 'temperatureMax': 73.22, 'apparentTemperatureMaxTime': 1466280000, 'temperatureMin': 65.31, 'ozone': 329.63, 'windSpeed': 2.92, 'moonPhase': 0.44, 'pressure': 1023.6}], 'summary': 'Light rain today and tomorrow, with temperatures falling to 72°F on Thursday.'}, 'longitude': -74.0063889, 'offset': -4, 'timezone': 'America/New_York'}
2) What's the current wind speed? How much warmer does it feel than it actually is?
In [15]:
type(data)
Out[15]:
dict
In [16]:
data.keys()
Out[16]:
dict_keys(['hourly', 'minutely', 'currently', 'flags', 'latitude', 'daily', 'longitude', 'offset', 'timezone'])
In [17]:
print(data['currently'])
{'icon': 'partly-cloudy-day', 'humidity': 0.55, 'summary': 'Partly Cloudy', 'dewPoint': 66.2, 'nearestStormDistance': 23, 'precipIntensity': 0, 'cloudCover': 0.34, 'time': 1465674190, 'nearestStormBearing': 225, 'temperature': 84.14, 'apparentTemperature': 86.47, 'visibility': 9.57, 'ozone': 318.57, 'precipProbability': 0, 'windBearing': 240, 'windSpeed': 6.61, 'pressure': 1008.19}
In [18]:
print(data['currently']['temperature']-data['currently']['apparentTemperature'])
-2.3299999999999983
3) The first daily forecast is the forecast for today. For the place you decided on up above, how much of the moon is currently visible?
In [19]:
print(data['daily'])
{'icon': 'rain', 'data': [{'precipType': 'rain', 'precipIntensity': 0.0063, 'cloudCover': 0.29, 'temperatureMaxTime': 1465675200, 'precipIntensityMaxTime': 1465686000, 'icon': 'rain', 'apparentTemperatureMin': 56.36, 'precipIntensityMax': 0.0542, 'sunriseTime': 1465637144, 'apparentTemperatureMinTime': 1465635600, 'apparentTemperatureMax': 87.07, 'summary': 'Rain starting in the evening.', 'windBearing': 226, 'time': 1465617600, 'humidity': 0.61, 'precipProbability': 0.66, 'dewPoint': 57.21, 'temperatureMinTime': 1465635600, 'apparentTemperatureMaxTime': 1465675200, 'temperatureMax': 84.59, 'sunsetTime': 1465691315, 'temperatureMin': 56.36, 'visibility': 9.7, 'ozone': 329.2, 'windSpeed': 4.06, 'moonPhase': 0.23, 'pressure': 1012.07}, {'precipType': 'rain', 'precipIntensity': 0.0007, 'cloudCover': 0.09, 'temperatureMaxTime': 1465750800, 'precipIntensityMaxTime': 1465722000, 'icon': 'clear-day', 'apparentTemperatureMin': 61.29, 'precipIntensityMax': 0.015, 'sunriseTime': 1465723540, 'apparentTemperatureMinTime': 1465786800, 'apparentTemperatureMax': 78.39, 'summary': 'Clear throughout the day.', 'windBearing': 285, 'time': 1465704000, 'humidity': 0.59, 'precipProbability': 0.51, 'dewPoint': 56.97, 'temperatureMinTime': 1465786800, 'apparentTemperatureMaxTime': 1465750800, 'temperatureMax': 78.39, 'sunsetTime': 1465777744, 'temperatureMin': 61.29, 'visibility': 9.81, 'ozone': 332.11, 'windSpeed': 12.3, 'moonPhase': 0.26, 'pressure': 1005.36}, {'precipIntensity': 0, 'cloudCover': 0.34, 'temperatureMaxTime': 1465851600, 'icon': 'partly-cloudy-night', 'apparentTemperatureMin': 56.88, 'precipIntensityMax': 0, 'sunriseTime': 1465809937, 'apparentTemperatureMinTime': 1465804800, 'apparentTemperatureMax': 77.11, 'summary': 'Mostly cloudy starting in the afternoon.', 'windBearing': 297, 'sunsetTime': 1465864170, 'humidity': 0.55, 'precipProbability': 0, 'dewPoint': 49.53, 'temperatureMinTime': 1465804800, 'time': 1465790400, 'temperatureMax': 77.11, 'apparentTemperatureMaxTime': 1465851600, 'temperatureMin': 56.88, 'visibility': 10, 'ozone': 333.06, 'windSpeed': 13.98, 'moonPhase': 0.29, 'pressure': 1008.87}, {'precipIntensity': 0, 'cloudCover': 0.4, 'temperatureMaxTime': 1465938000, 'icon': 'partly-cloudy-day', 'apparentTemperatureMin': 60.12, 'precipIntensityMax': 0, 'sunriseTime': 1465896336, 'apparentTemperatureMinTime': 1465898400, 'apparentTemperatureMax': 77.97, 'summary': 'Partly cloudy throughout the day.', 'windBearing': 288, 'sunsetTime': 1465950595, 'humidity': 0.5, 'precipProbability': 0, 'dewPoint': 49.07, 'temperatureMinTime': 1465898400, 'time': 1465876800, 'temperatureMax': 77.97, 'apparentTemperatureMaxTime': 1465938000, 'temperatureMin': 60.12, 'visibility': 10, 'ozone': 308.72, 'windSpeed': 7.09, 'moonPhase': 0.32, 'pressure': 1011.9}, {'precipType': 'rain', 'precipIntensity': 0.0017, 'cloudCover': 0.4, 'temperatureMaxTime': 1466024400, 'precipIntensityMaxTime': 1465995600, 'icon': 'partly-cloudy-day', 'apparentTemperatureMin': 64.38, 'precipIntensityMax': 0.0024, 'sunriseTime': 1465982737, 'apparentTemperatureMinTime': 1465984800, 'apparentTemperatureMax': 73.48, 'summary': 'Mostly cloudy throughout the day.', 'windBearing': 239, 'time': 1465963200, 'humidity': 0.71, 'precipProbability': 0.07, 'dewPoint': 58.7, 'temperatureMinTime': 1465984800, 'apparentTemperatureMaxTime': 1466024400, 'temperatureMax': 73.48, 'sunsetTime': 1466037018, 'temperatureMin': 64.38, 'ozone': 302.91, 'windSpeed': 2.4, 'moonPhase': 0.35, 'pressure': 1014.34}, {'precipType': 'rain', 'precipIntensity': 0.0026, 'cloudCover': 0.83, 'temperatureMaxTime': 1466110800, 'precipIntensityMaxTime': 1466103600, 'icon': 'partly-cloudy-day', 'apparentTemperatureMin': 66.28, 'precipIntensityMax': 0.0036, 'sunriseTime': 1466069139, 'apparentTemperatureMinTime': 1466074800, 'apparentTemperatureMax': 71.61, 'summary': 'Mostly cloudy throughout the day.', 'windBearing': 159, 'time': 1466049600, 'humidity': 0.71, 'precipProbability': 0.12, 'dewPoint': 58.67, 'temperatureMinTime': 1466074800, 'apparentTemperatureMaxTime': 1466110800, 'temperatureMax': 71.61, 'sunsetTime': 1466123440, 'temperatureMin': 66.28, 'ozone': 298.64, 'windSpeed': 1.42, 'moonPhase': 0.38, 'pressure': 1012.49}, {'precipType': 'rain', 'precipIntensity': 0.001, 'cloudCover': 0.72, 'temperatureMaxTime': 1466186400, 'precipIntensityMaxTime': 1466136000, 'icon': 'partly-cloudy-day', 'apparentTemperatureMin': 65.16, 'precipIntensityMax': 0.0017, 'sunriseTime': 1466155544, 'apparentTemperatureMinTime': 1466161200, 'apparentTemperatureMax': 71.89, 'summary': 'Mostly cloudy throughout the day.', 'windBearing': 93, 'time': 1466136000, 'humidity': 0.68, 'precipProbability': 0.04, 'dewPoint': 57.12, 'temperatureMinTime': 1466161200, 'apparentTemperatureMaxTime': 1466186400, 'temperatureMax': 71.89, 'sunsetTime': 1466209859, 'temperatureMin': 65.16, 'ozone': 317.52, 'windSpeed': 3.93, 'moonPhase': 0.41, 'pressure': 1016.18}, {'precipIntensity': 0, 'cloudCover': 0.01, 'temperatureMaxTime': 1466280000, 'icon': 'clear-day', 'apparentTemperatureMin': 65.31, 'precipIntensityMax': 0, 'sunriseTime': 1466241951, 'apparentTemperatureMinTime': 1466247600, 'apparentTemperatureMax': 73.22, 'summary': 'Clear throughout the day.', 'windBearing': 194, 'sunsetTime': 1466296277, 'humidity': 0.63, 'precipProbability': 0, 'dewPoint': 55.54, 'temperatureMinTime': 1466247600, 'time': 1466222400, 'temperatureMax': 73.22, 'apparentTemperatureMaxTime': 1466280000, 'temperatureMin': 65.31, 'ozone': 329.63, 'windSpeed': 2.92, 'moonPhase': 0.44, 'pressure': 1023.6}], 'summary': 'Light rain today and tomorrow, with temperatures falling to 72°F on Thursday.'}
In [22]:
type(data['daily'])
Out[22]:
dict
In [24]:
data['daily'].keys()
Out[24]:
dict_keys(['icon', 'data', 'summary'])
In [26]:
print(data['daily']['data'][0])
{'precipType': 'rain', 'precipIntensity': 0.0063, 'cloudCover': 0.29, 'temperatureMaxTime': 1465675200, 'precipIntensityMaxTime': 1465686000, 'icon': 'rain', 'apparentTemperatureMin': 56.36, 'precipIntensityMax': 0.0542, 'sunriseTime': 1465637144, 'apparentTemperatureMinTime': 1465635600, 'apparentTemperatureMax': 87.07, 'summary': 'Rain starting in the evening.', 'windBearing': 226, 'time': 1465617600, 'humidity': 0.61, 'precipProbability': 0.66, 'dewPoint': 57.21, 'temperatureMinTime': 1465635600, 'apparentTemperatureMaxTime': 1465675200, 'temperatureMax': 84.59, 'sunsetTime': 1465691315, 'temperatureMin': 56.36, 'visibility': 9.7, 'ozone': 329.2, 'windSpeed': 4.06, 'moonPhase': 0.23, 'pressure': 1012.07}
In [27]:
type(data['daily']['data'])
Out[27]:
list
In [28]:
print(data['daily']['data'][0]['moonPhase'])
0.23
4) What's the difference between the high and low temperatures for today?
In [29]:
weather_today = data['daily']['data'][0]
print(weather_today['temperatureMax']-weather_today['temperatureMin'])
28.230000000000004
5) Loop through the daily forecast, printing out the next week's worth of predictions. I'd like to know the high temperature for each day, and whether it's hot, warm, or cold, based on what temperatures you think are hot, warm or cold.
In [37]:
print(data['daily']['data'])
daily_data = data['daily']['data']
[{'precipType': 'rain', 'precipIntensity': 0.0063, 'cloudCover': 0.29, 'temperatureMaxTime': 1465675200, 'precipIntensityMaxTime': 1465686000, 'icon': 'rain', 'apparentTemperatureMin': 56.36, 'precipIntensityMax': 0.0542, 'sunriseTime': 1465637144, 'apparentTemperatureMinTime': 1465635600, 'apparentTemperatureMax': 87.07, 'summary': 'Rain starting in the evening.', 'windBearing': 226, 'time': 1465617600, 'humidity': 0.61, 'precipProbability': 0.66, 'dewPoint': 57.21, 'temperatureMinTime': 1465635600, 'apparentTemperatureMaxTime': 1465675200, 'temperatureMax': 84.59, 'sunsetTime': 1465691315, 'temperatureMin': 56.36, 'visibility': 9.7, 'ozone': 329.2, 'windSpeed': 4.06, 'moonPhase': 0.23, 'pressure': 1012.07}, {'precipType': 'rain', 'precipIntensity': 0.0007, 'cloudCover': 0.09, 'temperatureMaxTime': 1465750800, 'precipIntensityMaxTime': 1465722000, 'icon': 'clear-day', 'apparentTemperatureMin': 61.29, 'precipIntensityMax': 0.015, 'sunriseTime': 1465723540, 'apparentTemperatureMinTime': 1465786800, 'apparentTemperatureMax': 78.39, 'summary': 'Clear throughout the day.', 'windBearing': 285, 'time': 1465704000, 'humidity': 0.59, 'precipProbability': 0.51, 'dewPoint': 56.97, 'temperatureMinTime': 1465786800, 'apparentTemperatureMaxTime': 1465750800, 'temperatureMax': 78.39, 'sunsetTime': 1465777744, 'temperatureMin': 61.29, 'visibility': 9.81, 'ozone': 332.11, 'windSpeed': 12.3, 'moonPhase': 0.26, 'pressure': 1005.36}, {'precipIntensity': 0, 'cloudCover': 0.34, 'temperatureMaxTime': 1465851600, 'icon': 'partly-cloudy-night', 'apparentTemperatureMin': 56.88, 'precipIntensityMax': 0, 'sunriseTime': 1465809937, 'apparentTemperatureMinTime': 1465804800, 'apparentTemperatureMax': 77.11, 'summary': 'Mostly cloudy starting in the afternoon.', 'windBearing': 297, 'sunsetTime': 1465864170, 'humidity': 0.55, 'precipProbability': 0, 'dewPoint': 49.53, 'temperatureMinTime': 1465804800, 'time': 1465790400, 'temperatureMax': 77.11, 'apparentTemperatureMaxTime': 1465851600, 'temperatureMin': 56.88, 'visibility': 10, 'ozone': 333.06, 'windSpeed': 13.98, 'moonPhase': 0.29, 'pressure': 1008.87}, {'precipIntensity': 0, 'cloudCover': 0.4, 'temperatureMaxTime': 1465938000, 'icon': 'partly-cloudy-day', 'apparentTemperatureMin': 60.12, 'precipIntensityMax': 0, 'sunriseTime': 1465896336, 'apparentTemperatureMinTime': 1465898400, 'apparentTemperatureMax': 77.97, 'summary': 'Partly cloudy throughout the day.', 'windBearing': 288, 'sunsetTime': 1465950595, 'humidity': 0.5, 'precipProbability': 0, 'dewPoint': 49.07, 'temperatureMinTime': 1465898400, 'time': 1465876800, 'temperatureMax': 77.97, 'apparentTemperatureMaxTime': 1465938000, 'temperatureMin': 60.12, 'visibility': 10, 'ozone': 308.72, 'windSpeed': 7.09, 'moonPhase': 0.32, 'pressure': 1011.9}, {'precipType': 'rain', 'precipIntensity': 0.0017, 'cloudCover': 0.4, 'temperatureMaxTime': 1466024400, 'precipIntensityMaxTime': 1465995600, 'icon': 'partly-cloudy-day', 'apparentTemperatureMin': 64.38, 'precipIntensityMax': 0.0024, 'sunriseTime': 1465982737, 'apparentTemperatureMinTime': 1465984800, 'apparentTemperatureMax': 73.48, 'summary': 'Mostly cloudy throughout the day.', 'windBearing': 239, 'time': 1465963200, 'humidity': 0.71, 'precipProbability': 0.07, 'dewPoint': 58.7, 'temperatureMinTime': 1465984800, 'apparentTemperatureMaxTime': 1466024400, 'temperatureMax': 73.48, 'sunsetTime': 1466037018, 'temperatureMin': 64.38, 'ozone': 302.91, 'windSpeed': 2.4, 'moonPhase': 0.35, 'pressure': 1014.34}, {'precipType': 'rain', 'precipIntensity': 0.0026, 'cloudCover': 0.83, 'temperatureMaxTime': 1466110800, 'precipIntensityMaxTime': 1466103600, 'icon': 'partly-cloudy-day', 'apparentTemperatureMin': 66.28, 'precipIntensityMax': 0.0036, 'sunriseTime': 1466069139, 'apparentTemperatureMinTime': 1466074800, 'apparentTemperatureMax': 71.61, 'summary': 'Mostly cloudy throughout the day.', 'windBearing': 159, 'time': 1466049600, 'humidity': 0.71, 'precipProbability': 0.12, 'dewPoint': 58.67, 'temperatureMinTime': 1466074800, 'apparentTemperatureMaxTime': 1466110800, 'temperatureMax': 71.61, 'sunsetTime': 1466123440, 'temperatureMin': 66.28, 'ozone': 298.64, 'windSpeed': 1.42, 'moonPhase': 0.38, 'pressure': 1012.49}, {'precipType': 'rain', 'precipIntensity': 0.001, 'cloudCover': 0.72, 'temperatureMaxTime': 1466186400, 'precipIntensityMaxTime': 1466136000, 'icon': 'partly-cloudy-day', 'apparentTemperatureMin': 65.16, 'precipIntensityMax': 0.0017, 'sunriseTime': 1466155544, 'apparentTemperatureMinTime': 1466161200, 'apparentTemperatureMax': 71.89, 'summary': 'Mostly cloudy throughout the day.', 'windBearing': 93, 'time': 1466136000, 'humidity': 0.68, 'precipProbability': 0.04, 'dewPoint': 57.12, 'temperatureMinTime': 1466161200, 'apparentTemperatureMaxTime': 1466186400, 'temperatureMax': 71.89, 'sunsetTime': 1466209859, 'temperatureMin': 65.16, 'ozone': 317.52, 'windSpeed': 3.93, 'moonPhase': 0.41, 'pressure': 1016.18}, {'precipIntensity': 0, 'cloudCover': 0.01, 'temperatureMaxTime': 1466280000, 'icon': 'clear-day', 'apparentTemperatureMin': 65.31, 'precipIntensityMax': 0, 'sunriseTime': 1466241951, 'apparentTemperatureMinTime': 1466247600, 'apparentTemperatureMax': 73.22, 'summary': 'Clear throughout the day.', 'windBearing': 194, 'sunsetTime': 1466296277, 'humidity': 0.63, 'precipProbability': 0, 'dewPoint': 55.54, 'temperatureMinTime': 1466247600, 'time': 1466222400, 'temperatureMax': 73.22, 'apparentTemperatureMaxTime': 1466280000, 'temperatureMin': 65.31, 'ozone': 329.63, 'windSpeed': 2.92, 'moonPhase': 0.44, 'pressure': 1023.6}]
In [53]:
weather_next_week = data['daily']['data']
for weather in weather_next_week:
print(weather['temperatureMax'])
if weather['temperatureMax'] > 84:
print("it's a hot day.")
elif weather['temperatureMax'] > 74 and weather['temperatureMax'] < 83:
print("it's a warm day.")
else:
print("it's a cold day.")
84.59
it's a hot day.
78.39
it's a warm day.
77.11
it's a warm day.
77.97
it's a warm day.
73.48
it's a cold day.
71.61
it's a cold day.
71.89
it's a cold day.
73.22
it's a cold day.
6) What's the weather looking like for the rest of today in Miami, Florida? I'd like to know the temperature for every hour, and if it's going to have cloud cover of more than 0.5 say "{temperature} and cloudy" instead of just the temperature.
In [ ]:
import requests
In [54]:
response = requests.get("https://api.forecast.io/forecast/94bc3fa3628bfad686b10e7054c67f71/25.7738889, -80.1938889")
In [55]:
data = response.json()
In [57]:
print(data['hourly'])
{'icon': 'rain', 'data': [{'icon': 'rain', 'humidity': 0.84, 'summary': 'Rain', 'dewPoint': 75.11, 'precipIntensity': 0.0547, 'cloudCover': 0.4, 'time': 1465678800, 'visibility': 10, 'temperature': 80.41, 'apparentTemperature': 85.76, 'precipType': 'rain', 'ozone': 272.86, 'precipProbability': 0.66, 'windBearing': 127, 'windSpeed': 1.33, 'pressure': 1018.52}, {'icon': 'rain', 'humidity': 0.83, 'summary': 'Drizzle', 'dewPoint': 75.87, 'precipIntensity': 0.0062, 'cloudCover': 0.58, 'time': 1465682400, 'visibility': 9.68, 'temperature': 81.49, 'apparentTemperature': 88.28, 'precipType': 'rain', 'ozone': 272.87, 'precipProbability': 0.42, 'windBearing': 148, 'windSpeed': 0.67, 'pressure': 1018.59}, {'icon': 'rain', 'humidity': 0.83, 'summary': 'Light Rain', 'dewPoint': 75.59, 'precipIntensity': 0.0162, 'cloudCover': 0.74, 'time': 1465686000, 'visibility': 9.31, 'temperature': 81.18, 'apparentTemperature': 87.5, 'precipType': 'rain', 'ozone': 273.06, 'precipProbability': 0.52, 'windBearing': 91, 'windSpeed': 1.03, 'pressure': 1018.63}, {'icon': 'rain', 'humidity': 0.84, 'summary': 'Drizzle', 'dewPoint': 75.07, 'precipIntensity': 0.0078, 'cloudCover': 0.85, 'time': 1465689600, 'visibility': 9.13, 'temperature': 80.49, 'apparentTemperature': 85.89, 'precipType': 'rain', 'ozone': 273.29, 'precipProbability': 0.36, 'windBearing': 97, 'windSpeed': 2.3, 'pressure': 1018.68}, {'icon': 'partly-cloudy-night', 'humidity': 0.85, 'summary': 'Mostly Cloudy', 'dewPoint': 75.35, 'precipIntensity': 0.0038, 'cloudCover': 0.89, 'time': 1465693200, 'visibility': 9.07, 'temperature': 80.2, 'apparentTemperature': 85.47, 'precipType': 'rain', 'ozone': 273.49, 'precipProbability': 0.13, 'windBearing': 120, 'windSpeed': 2.85, 'pressure': 1018.83}, {'icon': 'partly-cloudy-night', 'humidity': 0.86, 'summary': 'Mostly Cloudy', 'dewPoint': 75.43, 'precipIntensity': 0.0019, 'cloudCover': 0.87, 'time': 1465696800, 'visibility': 9.05, 'temperature': 79.92, 'apparentTemperature': 79.92, 'precipType': 'rain', 'ozone': 273.73, 'precipProbability': 0.05, 'windBearing': 118, 'windSpeed': 2.66, 'pressure': 1019.08}, {'icon': 'partly-cloudy-night', 'humidity': 0.87, 'summary': 'Mostly Cloudy', 'dewPoint': 75.59, 'precipIntensity': 0.0014, 'cloudCover': 0.87, 'time': 1465700400, 'visibility': 8.66, 'temperature': 79.64, 'apparentTemperature': 79.64, 'precipType': 'rain', 'ozone': 273.99, 'precipProbability': 0.03, 'windBearing': 117, 'windSpeed': 2.31, 'pressure': 1019.3}, {'icon': 'partly-cloudy-night', 'humidity': 0.88, 'summary': 'Mostly Cloudy', 'dewPoint': 75.25, 'precipIntensity': 0, 'cloudCover': 0.81, 'time': 1465704000, 'temperature': 79.26, 'apparentTemperature': 79.26, 'visibility': 8.73, 'ozone': 274.31, 'precipProbability': 0, 'windBearing': 135, 'windSpeed': 1.82, 'pressure': 1019.11}, {'icon': 'partly-cloudy-night', 'humidity': 0.88, 'summary': 'Mostly Cloudy', 'dewPoint': 74.93, 'precipIntensity': 0, 'cloudCover': 0.74, 'time': 1465707600, 'temperature': 78.65, 'apparentTemperature': 78.65, 'visibility': 8.68, 'ozone': 274.66, 'precipProbability': 0, 'windBearing': 167, 'windSpeed': 1.92, 'pressure': 1018.79}, {'icon': 'partly-cloudy-night', 'humidity': 0.9, 'summary': 'Mostly Cloudy', 'dewPoint': 74.47, 'precipIntensity': 0, 'cloudCover': 0.67, 'time': 1465711200, 'temperature': 77.69, 'apparentTemperature': 77.69, 'visibility': 8.62, 'ozone': 274.96, 'precipProbability': 0, 'windBearing': 196, 'windSpeed': 1.09, 'pressure': 1018.51}, {'icon': 'partly-cloudy-night', 'humidity': 0.91, 'summary': 'Mostly Cloudy', 'dewPoint': 74.15, 'precipIntensity': 0, 'cloudCover': 0.6, 'time': 1465714800, 'temperature': 77, 'apparentTemperature': 77, 'visibility': 8.64, 'ozone': 275.15, 'precipProbability': 0, 'windBearing': 291, 'windSpeed': 0.76, 'pressure': 1018.3}, {'icon': 'partly-cloudy-night', 'humidity': 0.91, 'summary': 'Partly Cloudy', 'dewPoint': 73.82, 'precipIntensity': 0.0008, 'cloudCover': 0.55, 'time': 1465718400, 'visibility': 8.62, 'temperature': 76.61, 'apparentTemperature': 76.61, 'precipType': 'rain', 'ozone': 275.29, 'precipProbability': 0.01, 'windBearing': 312, 'windSpeed': 1.9, 'pressure': 1018.15}, {'icon': 'partly-cloudy-night', 'humidity': 0.91, 'summary': 'Partly Cloudy', 'dewPoint': 73.31, 'precipIntensity': 0.0012, 'cloudCover': 0.56, 'time': 1465722000, 'visibility': 8.6, 'temperature': 76.11, 'apparentTemperature': 76.11, 'precipType': 'rain', 'ozone': 275.58, 'precipProbability': 0.02, 'windBearing': 326, 'windSpeed': 3.01, 'pressure': 1018.13}, {'icon': 'partly-cloudy-night', 'humidity': 0.91, 'summary': 'Mostly Cloudy', 'dewPoint': 74.01, 'precipIntensity': 0.0018, 'cloudCover': 0.62, 'time': 1465725600, 'visibility': 8.53, 'temperature': 76.92, 'apparentTemperature': 76.92, 'precipType': 'rain', 'ozone': 276.16, 'precipProbability': 0.04, 'windBearing': 334, 'windSpeed': 3.88, 'pressure': 1018.35}, {'icon': 'partly-cloudy-day', 'humidity': 0.91, 'summary': 'Mostly Cloudy', 'dewPoint': 75.24, 'precipIntensity': 0.0028, 'cloudCover': 0.72, 'time': 1465729200, 'visibility': 8.37, 'temperature': 78.23, 'apparentTemperature': 78.23, 'precipType': 'rain', 'ozone': 276.9, 'precipProbability': 0.08, 'windBearing': 341, 'windSpeed': 4.8, 'pressure': 1018.66}, {'icon': 'partly-cloudy-day', 'humidity': 0.88, 'summary': 'Mostly Cloudy', 'dewPoint': 75.82, 'precipIntensity': 0.0036, 'cloudCover': 0.61, 'time': 1465732800, 'visibility': 8.37, 'temperature': 79.78, 'apparentTemperature': 79.78, 'precipType': 'rain', 'ozone': 277.53, 'precipProbability': 0.12, 'windBearing': 350, 'windSpeed': 5.73, 'pressure': 1018.9}, {'icon': 'rain', 'humidity': 0.83, 'summary': 'Drizzle', 'dewPoint': 75.83, 'precipIntensity': 0.0063, 'cloudCover': 0.62, 'time': 1465736400, 'visibility': 8.61, 'temperature': 81.33, 'apparentTemperature': 87.95, 'precipType': 'rain', 'ozone': 277.93, 'precipProbability': 0.27, 'windBearing': 1, 'windSpeed': 6.06, 'pressure': 1019.02}, {'icon': 'rain', 'humidity': 0.79, 'summary': 'Drizzle', 'dewPoint': 75.65, 'precipIntensity': 0.0058, 'cloudCover': 0.62, 'time': 1465740000, 'visibility': 8.92, 'temperature': 82.77, 'apparentTemperature': 90.48, 'precipType': 'rain', 'ozone': 278.23, 'precipProbability': 0.24, 'windBearing': 12, 'windSpeed': 6.01, 'pressure': 1019.09}, {'icon': 'partly-cloudy-day', 'humidity': 0.75, 'summary': 'Partly Cloudy', 'dewPoint': 75.57, 'precipIntensity': 0.0037, 'cloudCover': 0.57, 'time': 1465743600, 'visibility': 9.4, 'temperature': 84.42, 'apparentTemperature': 93.17, 'precipType': 'rain', 'ozone': 278.46, 'precipProbability': 0.13, 'windBearing': 22, 'windSpeed': 5.76, 'pressure': 1019.1}, {'icon': 'partly-cloudy-day', 'humidity': 0.72, 'summary': 'Partly Cloudy', 'dewPoint': 75.78, 'precipIntensity': 0.0026, 'cloudCover': 0.57, 'time': 1465747200, 'visibility': 9.61, 'temperature': 85.74, 'apparentTemperature': 95.44, 'precipType': 'rain', 'ozone': 278.64, 'precipProbability': 0.08, 'windBearing': 33, 'windSpeed': 5.51, 'pressure': 1019.06}, {'icon': 'partly-cloudy-day', 'humidity': 0.71, 'summary': 'Partly Cloudy', 'dewPoint': 76.33, 'precipIntensity': 0.0029, 'cloudCover': 0.58, 'time': 1465750800, 'visibility': 9.6, 'temperature': 86.83, 'apparentTemperature': 97.7, 'precipType': 'rain', 'ozone': 278.76, 'precipProbability': 0.09, 'windBearing': 45, 'windSpeed': 5.46, 'pressure': 1018.95}, {'icon': 'rain', 'humidity': 0.71, 'summary': 'Drizzle', 'dewPoint': 75.86, 'precipIntensity': 0.0055, 'cloudCover': 0.6, 'time': 1465754400, 'visibility': 9.14, 'temperature': 86.36, 'apparentTemperature': 96.46, 'precipType': 'rain', 'ozone': 278.87, 'precipProbability': 0.23, 'windBearing': 54, 'windSpeed': 5.49, 'pressure': 1018.73}, {'icon': 'rain', 'humidity': 0.71, 'summary': 'Light Rain', 'dewPoint': 75.43, 'precipIntensity': 0.0128, 'cloudCover': 0.67, 'time': 1465758000, 'visibility': 9.73, 'temperature': 86.12, 'apparentTemperature': 95.63, 'precipType': 'rain', 'ozone': 278.87, 'precipProbability': 0.49, 'windBearing': 71, 'windSpeed': 5.75, 'pressure': 1018.27}, {'icon': 'rain', 'humidity': 0.71, 'summary': 'Light Rain', 'dewPoint': 74.63, 'precipIntensity': 0.0223, 'cloudCover': 0.84, 'time': 1465761600, 'visibility': 9.79, 'temperature': 84.97, 'apparentTemperature': 93.14, 'precipType': 'rain', 'ozone': 278.85, 'precipProbability': 0.55, 'windBearing': 78, 'windSpeed': 5.62, 'pressure': 1017.71}, {'icon': 'rain', 'humidity': 0.73, 'summary': 'Light Rain', 'dewPoint': 74.64, 'precipIntensity': 0.027, 'cloudCover': 0.88, 'time': 1465765200, 'visibility': 9.73, 'temperature': 84.35, 'apparentTemperature': 92.22, 'precipType': 'rain', 'ozone': 279.15, 'precipProbability': 0.58, 'windBearing': 83, 'windSpeed': 5.58, 'pressure': 1017.29}, {'icon': 'rain', 'humidity': 0.75, 'summary': 'Light Rain', 'dewPoint': 74.56, 'precipIntensity': 0.0225, 'cloudCover': 0.91, 'time': 1465768800, 'visibility': 9.78, 'temperature': 83.52, 'apparentTemperature': 90.86, 'precipType': 'rain', 'ozone': 279.97, 'precipProbability': 0.56, 'windBearing': 81, 'windSpeed': 5.64, 'pressure': 1017.11}, {'icon': 'rain', 'humidity': 0.77, 'summary': 'Light Rain', 'dewPoint': 74.74, 'precipIntensity': 0.0132, 'cloudCover': 0.9, 'time': 1465772400, 'visibility': 9.89, 'temperature': 82.78, 'apparentTemperature': 89.79, 'precipType': 'rain', 'ozone': 281.11, 'precipProbability': 0.49, 'windBearing': 77, 'windSpeed': 5.71, 'pressure': 1017.08}, {'icon': 'rain', 'humidity': 0.79, 'summary': 'Drizzle', 'dewPoint': 74.96, 'precipIntensity': 0.0057, 'cloudCover': 0.89, 'time': 1465776000, 'visibility': 10, 'temperature': 82.24, 'apparentTemperature': 89.06, 'precipType': 'rain', 'ozone': 282.27, 'precipProbability': 0.24, 'windBearing': 74, 'windSpeed': 5.73, 'pressure': 1017.1}, {'icon': 'partly-cloudy-night', 'humidity': 0.8, 'summary': 'Mostly Cloudy', 'dewPoint': 75, 'precipIntensity': 0.0026, 'cloudCover': 0.88, 'time': 1465779600, 'visibility': 10, 'temperature': 81.75, 'apparentTemperature': 88.22, 'precipType': 'rain', 'ozone': 283.36, 'precipProbability': 0.08, 'windBearing': 74, 'windSpeed': 5.63, 'pressure': 1017.23}, {'icon': 'partly-cloudy-night', 'humidity': 0.81, 'summary': 'Mostly Cloudy', 'dewPoint': 74.97, 'precipIntensity': 0.0011, 'cloudCover': 0.86, 'time': 1465783200, 'visibility': 10, 'temperature': 81.25, 'apparentTemperature': 87.29, 'precipType': 'rain', 'ozone': 284.47, 'precipProbability': 0.02, 'windBearing': 74, 'windSpeed': 5.47, 'pressure': 1017.41}, {'icon': 'partly-cloudy-night', 'humidity': 0.82, 'summary': 'Mostly Cloudy', 'dewPoint': 74.82, 'precipIntensity': 0, 'cloudCover': 0.83, 'time': 1465786800, 'temperature': 80.78, 'apparentTemperature': 86.33, 'visibility': 10, 'ozone': 285.64, 'precipProbability': 0, 'windBearing': 76, 'windSpeed': 5.18, 'pressure': 1017.41}, {'icon': 'partly-cloudy-night', 'humidity': 0.83, 'summary': 'Mostly Cloudy', 'dewPoint': 74.65, 'precipIntensity': 0, 'cloudCover': 0.73, 'time': 1465790400, 'temperature': 80.36, 'apparentTemperature': 85.46, 'visibility': 10, 'ozone': 287.02, 'precipProbability': 0, 'windBearing': 84, 'windSpeed': 4.64, 'pressure': 1017.1}, {'icon': 'partly-cloudy-night', 'humidity': 0.83, 'summary': 'Partly Cloudy', 'dewPoint': 74.39, 'precipIntensity': 0, 'cloudCover': 0.59, 'time': 1465794000, 'temperature': 79.93, 'apparentTemperature': 79.93, 'visibility': 10, 'ozone': 288.46, 'precipProbability': 0, 'windBearing': 97, 'windSpeed': 4.04, 'pressure': 1016.63}, {'icon': 'partly-cloudy-night', 'humidity': 0.84, 'summary': 'Partly Cloudy', 'dewPoint': 73.99, 'precipIntensity': 0, 'cloudCover': 0.47, 'time': 1465797600, 'temperature': 79.35, 'apparentTemperature': 79.35, 'visibility': 10, 'ozone': 289.59, 'precipProbability': 0, 'windBearing': 110, 'windSpeed': 3.48, 'pressure': 1016.18}, {'icon': 'partly-cloudy-night', 'humidity': 0.84, 'summary': 'Partly Cloudy', 'dewPoint': 73.42, 'precipIntensity': 0, 'cloudCover': 0.4, 'time': 1465801200, 'temperature': 78.55, 'apparentTemperature': 78.55, 'visibility': 10, 'ozone': 290.09, 'precipProbability': 0, 'windBearing': 116, 'windSpeed': 2.54, 'pressure': 1015.78}, {'icon': 'partly-cloudy-night', 'humidity': 0.85, 'summary': 'Partly Cloudy', 'dewPoint': 72.77, 'precipIntensity': 0, 'cloudCover': 0.36, 'time': 1465804800, 'temperature': 77.69, 'apparentTemperature': 77.69, 'visibility': 10, 'ozone': 290.27, 'precipProbability': 0, 'windBearing': 117, 'windSpeed': 1.29, 'pressure': 1015.41}, {'icon': 'partly-cloudy-night', 'humidity': 0.85, 'summary': 'Partly Cloudy', 'dewPoint': 72.21, 'precipIntensity': 0, 'cloudCover': 0.33, 'time': 1465808400, 'temperature': 77, 'apparentTemperature': 77, 'visibility': 10, 'ozone': 290.69, 'precipProbability': 0, 'windBearing': 109, 'windSpeed': 0.28, 'pressure': 1015.24}, {'icon': 'partly-cloudy-night', 'humidity': 0.85, 'summary': 'Partly Cloudy', 'dewPoint': 71.97, 'precipIntensity': 0, 'cloudCover': 0.32, 'time': 1465812000, 'temperature': 76.68, 'apparentTemperature': 76.68, 'visibility': 10, 'ozone': 291.53, 'precipProbability': 0, 'windBearing': 332, 'windSpeed': 0.27, 'pressure': 1015.4}, {'icon': 'partly-cloudy-day', 'humidity': 0.85, 'summary': 'Partly Cloudy', 'dewPoint': 72.84, 'precipIntensity': 0, 'cloudCover': 0.31, 'time': 1465815600, 'temperature': 77.58, 'apparentTemperature': 77.58, 'visibility': 10, 'ozone': 292.6, 'precipProbability': 0, 'windBearing': 343, 'windSpeed': 0.58, 'pressure': 1015.74}, {'icon': 'partly-cloudy-day', 'humidity': 0.84, 'summary': 'Partly Cloudy', 'dewPoint': 73.89, 'precipIntensity': 0, 'cloudCover': 0.28, 'time': 1465819200, 'temperature': 79.05, 'apparentTemperature': 79.05, 'visibility': 10, 'ozone': 293.89, 'precipProbability': 0, 'windBearing': 359, 'windSpeed': 0.97, 'pressure': 1016.09}, {'icon': 'clear-day', 'humidity': 0.81, 'summary': 'Clear', 'dewPoint': 74.49, 'precipIntensity': 0, 'cloudCover': 0.2, 'time': 1465822800, 'temperature': 80.83, 'apparentTemperature': 86.26, 'visibility': 10, 'ozone': 295.58, 'precipProbability': 0, 'windBearing': 9, 'windSpeed': 1.75, 'pressure': 1016.49}, {'icon': 'clear-day', 'humidity': 0.77, 'summary': 'Clear', 'dewPoint': 74.62, 'precipIntensity': 0, 'cloudCover': 0.1, 'time': 1465826400, 'temperature': 82.62, 'apparentTemperature': 89.46, 'visibility': 10, 'ozone': 297.49, 'precipProbability': 0, 'windBearing': 16, 'windSpeed': 2.89, 'pressure': 1016.9}, {'icon': 'clear-day', 'humidity': 0.73, 'summary': 'Clear', 'dewPoint': 74.67, 'precipIntensity': 0, 'cloudCover': 0.07, 'time': 1465830000, 'temperature': 84.15, 'apparentTemperature': 91.94, 'visibility': 10, 'ozone': 299.04, 'precipProbability': 0, 'windBearing': 26, 'windSpeed': 3.72, 'pressure': 1017.11}, {'icon': 'clear-day', 'humidity': 0.71, 'summary': 'Clear', 'dewPoint': 74.95, 'precipIntensity': 0, 'cloudCover': 0.21, 'time': 1465833600, 'temperature': 85.5, 'apparentTemperature': 94.24, 'visibility': 10, 'ozone': 300.07, 'precipProbability': 0, 'windBearing': 44, 'windSpeed': 4.01, 'pressure': 1016.91}, {'icon': 'partly-cloudy-day', 'humidity': 0.69, 'summary': 'Partly Cloudy', 'dewPoint': 75.52, 'precipIntensity': 0, 'cloudCover': 0.4, 'time': 1465837200, 'temperature': 86.89, 'apparentTemperature': 96.86, 'visibility': 10, 'ozone': 300.75, 'precipProbability': 0, 'windBearing': 65, 'windSpeed': 4.23, 'pressure': 1016.44}, {'icon': 'partly-cloudy-day', 'humidity': 0.68, 'summary': 'Partly Cloudy', 'dewPoint': 76.11, 'precipIntensity': 0, 'cloudCover': 0.51, 'time': 1465840800, 'temperature': 87.83, 'apparentTemperature': 98.92, 'visibility': 10, 'ozone': 301.08, 'precipProbability': 0, 'windBearing': 84, 'windSpeed': 4.78, 'pressure': 1015.87}, {'icon': 'partly-cloudy-day', 'humidity': 0.69, 'summary': 'Partly Cloudy', 'dewPoint': 75.87, 'precipIntensity': 0.0017, 'cloudCover': 0.49, 'time': 1465844400, 'visibility': 10, 'temperature': 87.2, 'apparentTemperature': 97.72, 'precipType': 'rain', 'ozone': 300.81, 'precipProbability': 0.04, 'windBearing': 97, 'windSpeed': 6.05, 'pressure': 1015.22}, {'icon': 'partly-cloudy-day', 'humidity': 0.71, 'summary': 'Partly Cloudy', 'dewPoint': 75.57, 'precipIntensity': 0.0041, 'cloudCover': 0.39, 'time': 1465848000, 'visibility': 10, 'temperature': 86.07, 'apparentTemperature': 95.71, 'precipType': 'rain', 'ozone': 300.19, 'precipProbability': 0.15, 'windBearing': 107, 'windSpeed': 7.51, 'pressure': 1014.56}, {'icon': 'rain', 'humidity': 0.73, 'summary': 'Drizzle', 'dewPoint': 75.14, 'precipIntensity': 0.0064, 'cloudCover': 0.34, 'time': 1465851600, 'visibility': 10, 'temperature': 84.83, 'apparentTemperature': 93.4, 'precipType': 'rain', 'ozone': 299.99, 'precipProbability': 0.28, 'windBearing': 114, 'windSpeed': 8.48, 'pressure': 1014.14}], 'summary': 'Rain later this evening and tomorrow afternoon.'}
In [58]:
data['hourly'].keys()
Out[58]:
dict_keys(['icon', 'data', 'summary'])
In [59]:
data['hourly']['data']
Out[59]:
[{'apparentTemperature': 85.76,
'cloudCover': 0.4,
'dewPoint': 75.11,
'humidity': 0.84,
'icon': 'rain',
'ozone': 272.86,
'precipIntensity': 0.0547,
'precipProbability': 0.66,
'precipType': 'rain',
'pressure': 1018.52,
'summary': 'Rain',
'temperature': 80.41,
'time': 1465678800,
'visibility': 10,
'windBearing': 127,
'windSpeed': 1.33},
{'apparentTemperature': 88.28,
'cloudCover': 0.58,
'dewPoint': 75.87,
'humidity': 0.83,
'icon': 'rain',
'ozone': 272.87,
'precipIntensity': 0.0062,
'precipProbability': 0.42,
'precipType': 'rain',
'pressure': 1018.59,
'summary': 'Drizzle',
'temperature': 81.49,
'time': 1465682400,
'visibility': 9.68,
'windBearing': 148,
'windSpeed': 0.67},
{'apparentTemperature': 87.5,
'cloudCover': 0.74,
'dewPoint': 75.59,
'humidity': 0.83,
'icon': 'rain',
'ozone': 273.06,
'precipIntensity': 0.0162,
'precipProbability': 0.52,
'precipType': 'rain',
'pressure': 1018.63,
'summary': 'Light Rain',
'temperature': 81.18,
'time': 1465686000,
'visibility': 9.31,
'windBearing': 91,
'windSpeed': 1.03},
{'apparentTemperature': 85.89,
'cloudCover': 0.85,
'dewPoint': 75.07,
'humidity': 0.84,
'icon': 'rain',
'ozone': 273.29,
'precipIntensity': 0.0078,
'precipProbability': 0.36,
'precipType': 'rain',
'pressure': 1018.68,
'summary': 'Drizzle',
'temperature': 80.49,
'time': 1465689600,
'visibility': 9.13,
'windBearing': 97,
'windSpeed': 2.3},
{'apparentTemperature': 85.47,
'cloudCover': 0.89,
'dewPoint': 75.35,
'humidity': 0.85,
'icon': 'partly-cloudy-night',
'ozone': 273.49,
'precipIntensity': 0.0038,
'precipProbability': 0.13,
'precipType': 'rain',
'pressure': 1018.83,
'summary': 'Mostly Cloudy',
'temperature': 80.2,
'time': 1465693200,
'visibility': 9.07,
'windBearing': 120,
'windSpeed': 2.85},
{'apparentTemperature': 79.92,
'cloudCover': 0.87,
'dewPoint': 75.43,
'humidity': 0.86,
'icon': 'partly-cloudy-night',
'ozone': 273.73,
'precipIntensity': 0.0019,
'precipProbability': 0.05,
'precipType': 'rain',
'pressure': 1019.08,
'summary': 'Mostly Cloudy',
'temperature': 79.92,
'time': 1465696800,
'visibility': 9.05,
'windBearing': 118,
'windSpeed': 2.66},
{'apparentTemperature': 79.64,
'cloudCover': 0.87,
'dewPoint': 75.59,
'humidity': 0.87,
'icon': 'partly-cloudy-night',
'ozone': 273.99,
'precipIntensity': 0.0014,
'precipProbability': 0.03,
'precipType': 'rain',
'pressure': 1019.3,
'summary': 'Mostly Cloudy',
'temperature': 79.64,
'time': 1465700400,
'visibility': 8.66,
'windBearing': 117,
'windSpeed': 2.31},
{'apparentTemperature': 79.26,
'cloudCover': 0.81,
'dewPoint': 75.25,
'humidity': 0.88,
'icon': 'partly-cloudy-night',
'ozone': 274.31,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1019.11,
'summary': 'Mostly Cloudy',
'temperature': 79.26,
'time': 1465704000,
'visibility': 8.73,
'windBearing': 135,
'windSpeed': 1.82},
{'apparentTemperature': 78.65,
'cloudCover': 0.74,
'dewPoint': 74.93,
'humidity': 0.88,
'icon': 'partly-cloudy-night',
'ozone': 274.66,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1018.79,
'summary': 'Mostly Cloudy',
'temperature': 78.65,
'time': 1465707600,
'visibility': 8.68,
'windBearing': 167,
'windSpeed': 1.92},
{'apparentTemperature': 77.69,
'cloudCover': 0.67,
'dewPoint': 74.47,
'humidity': 0.9,
'icon': 'partly-cloudy-night',
'ozone': 274.96,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1018.51,
'summary': 'Mostly Cloudy',
'temperature': 77.69,
'time': 1465711200,
'visibility': 8.62,
'windBearing': 196,
'windSpeed': 1.09},
{'apparentTemperature': 77,
'cloudCover': 0.6,
'dewPoint': 74.15,
'humidity': 0.91,
'icon': 'partly-cloudy-night',
'ozone': 275.15,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1018.3,
'summary': 'Mostly Cloudy',
'temperature': 77,
'time': 1465714800,
'visibility': 8.64,
'windBearing': 291,
'windSpeed': 0.76},
{'apparentTemperature': 76.61,
'cloudCover': 0.55,
'dewPoint': 73.82,
'humidity': 0.91,
'icon': 'partly-cloudy-night',
'ozone': 275.29,
'precipIntensity': 0.0008,
'precipProbability': 0.01,
'precipType': 'rain',
'pressure': 1018.15,
'summary': 'Partly Cloudy',
'temperature': 76.61,
'time': 1465718400,
'visibility': 8.62,
'windBearing': 312,
'windSpeed': 1.9},
{'apparentTemperature': 76.11,
'cloudCover': 0.56,
'dewPoint': 73.31,
'humidity': 0.91,
'icon': 'partly-cloudy-night',
'ozone': 275.58,
'precipIntensity': 0.0012,
'precipProbability': 0.02,
'precipType': 'rain',
'pressure': 1018.13,
'summary': 'Partly Cloudy',
'temperature': 76.11,
'time': 1465722000,
'visibility': 8.6,
'windBearing': 326,
'windSpeed': 3.01},
{'apparentTemperature': 76.92,
'cloudCover': 0.62,
'dewPoint': 74.01,
'humidity': 0.91,
'icon': 'partly-cloudy-night',
'ozone': 276.16,
'precipIntensity': 0.0018,
'precipProbability': 0.04,
'precipType': 'rain',
'pressure': 1018.35,
'summary': 'Mostly Cloudy',
'temperature': 76.92,
'time': 1465725600,
'visibility': 8.53,
'windBearing': 334,
'windSpeed': 3.88},
{'apparentTemperature': 78.23,
'cloudCover': 0.72,
'dewPoint': 75.24,
'humidity': 0.91,
'icon': 'partly-cloudy-day',
'ozone': 276.9,
'precipIntensity': 0.0028,
'precipProbability': 0.08,
'precipType': 'rain',
'pressure': 1018.66,
'summary': 'Mostly Cloudy',
'temperature': 78.23,
'time': 1465729200,
'visibility': 8.37,
'windBearing': 341,
'windSpeed': 4.8},
{'apparentTemperature': 79.78,
'cloudCover': 0.61,
'dewPoint': 75.82,
'humidity': 0.88,
'icon': 'partly-cloudy-day',
'ozone': 277.53,
'precipIntensity': 0.0036,
'precipProbability': 0.12,
'precipType': 'rain',
'pressure': 1018.9,
'summary': 'Mostly Cloudy',
'temperature': 79.78,
'time': 1465732800,
'visibility': 8.37,
'windBearing': 350,
'windSpeed': 5.73},
{'apparentTemperature': 87.95,
'cloudCover': 0.62,
'dewPoint': 75.83,
'humidity': 0.83,
'icon': 'rain',
'ozone': 277.93,
'precipIntensity': 0.0063,
'precipProbability': 0.27,
'precipType': 'rain',
'pressure': 1019.02,
'summary': 'Drizzle',
'temperature': 81.33,
'time': 1465736400,
'visibility': 8.61,
'windBearing': 1,
'windSpeed': 6.06},
{'apparentTemperature': 90.48,
'cloudCover': 0.62,
'dewPoint': 75.65,
'humidity': 0.79,
'icon': 'rain',
'ozone': 278.23,
'precipIntensity': 0.0058,
'precipProbability': 0.24,
'precipType': 'rain',
'pressure': 1019.09,
'summary': 'Drizzle',
'temperature': 82.77,
'time': 1465740000,
'visibility': 8.92,
'windBearing': 12,
'windSpeed': 6.01},
{'apparentTemperature': 93.17,
'cloudCover': 0.57,
'dewPoint': 75.57,
'humidity': 0.75,
'icon': 'partly-cloudy-day',
'ozone': 278.46,
'precipIntensity': 0.0037,
'precipProbability': 0.13,
'precipType': 'rain',
'pressure': 1019.1,
'summary': 'Partly Cloudy',
'temperature': 84.42,
'time': 1465743600,
'visibility': 9.4,
'windBearing': 22,
'windSpeed': 5.76},
{'apparentTemperature': 95.44,
'cloudCover': 0.57,
'dewPoint': 75.78,
'humidity': 0.72,
'icon': 'partly-cloudy-day',
'ozone': 278.64,
'precipIntensity': 0.0026,
'precipProbability': 0.08,
'precipType': 'rain',
'pressure': 1019.06,
'summary': 'Partly Cloudy',
'temperature': 85.74,
'time': 1465747200,
'visibility': 9.61,
'windBearing': 33,
'windSpeed': 5.51},
{'apparentTemperature': 97.7,
'cloudCover': 0.58,
'dewPoint': 76.33,
'humidity': 0.71,
'icon': 'partly-cloudy-day',
'ozone': 278.76,
'precipIntensity': 0.0029,
'precipProbability': 0.09,
'precipType': 'rain',
'pressure': 1018.95,
'summary': 'Partly Cloudy',
'temperature': 86.83,
'time': 1465750800,
'visibility': 9.6,
'windBearing': 45,
'windSpeed': 5.46},
{'apparentTemperature': 96.46,
'cloudCover': 0.6,
'dewPoint': 75.86,
'humidity': 0.71,
'icon': 'rain',
'ozone': 278.87,
'precipIntensity': 0.0055,
'precipProbability': 0.23,
'precipType': 'rain',
'pressure': 1018.73,
'summary': 'Drizzle',
'temperature': 86.36,
'time': 1465754400,
'visibility': 9.14,
'windBearing': 54,
'windSpeed': 5.49},
{'apparentTemperature': 95.63,
'cloudCover': 0.67,
'dewPoint': 75.43,
'humidity': 0.71,
'icon': 'rain',
'ozone': 278.87,
'precipIntensity': 0.0128,
'precipProbability': 0.49,
'precipType': 'rain',
'pressure': 1018.27,
'summary': 'Light Rain',
'temperature': 86.12,
'time': 1465758000,
'visibility': 9.73,
'windBearing': 71,
'windSpeed': 5.75},
{'apparentTemperature': 93.14,
'cloudCover': 0.84,
'dewPoint': 74.63,
'humidity': 0.71,
'icon': 'rain',
'ozone': 278.85,
'precipIntensity': 0.0223,
'precipProbability': 0.55,
'precipType': 'rain',
'pressure': 1017.71,
'summary': 'Light Rain',
'temperature': 84.97,
'time': 1465761600,
'visibility': 9.79,
'windBearing': 78,
'windSpeed': 5.62},
{'apparentTemperature': 92.22,
'cloudCover': 0.88,
'dewPoint': 74.64,
'humidity': 0.73,
'icon': 'rain',
'ozone': 279.15,
'precipIntensity': 0.027,
'precipProbability': 0.58,
'precipType': 'rain',
'pressure': 1017.29,
'summary': 'Light Rain',
'temperature': 84.35,
'time': 1465765200,
'visibility': 9.73,
'windBearing': 83,
'windSpeed': 5.58},
{'apparentTemperature': 90.86,
'cloudCover': 0.91,
'dewPoint': 74.56,
'humidity': 0.75,
'icon': 'rain',
'ozone': 279.97,
'precipIntensity': 0.0225,
'precipProbability': 0.56,
'precipType': 'rain',
'pressure': 1017.11,
'summary': 'Light Rain',
'temperature': 83.52,
'time': 1465768800,
'visibility': 9.78,
'windBearing': 81,
'windSpeed': 5.64},
{'apparentTemperature': 89.79,
'cloudCover': 0.9,
'dewPoint': 74.74,
'humidity': 0.77,
'icon': 'rain',
'ozone': 281.11,
'precipIntensity': 0.0132,
'precipProbability': 0.49,
'precipType': 'rain',
'pressure': 1017.08,
'summary': 'Light Rain',
'temperature': 82.78,
'time': 1465772400,
'visibility': 9.89,
'windBearing': 77,
'windSpeed': 5.71},
{'apparentTemperature': 89.06,
'cloudCover': 0.89,
'dewPoint': 74.96,
'humidity': 0.79,
'icon': 'rain',
'ozone': 282.27,
'precipIntensity': 0.0057,
'precipProbability': 0.24,
'precipType': 'rain',
'pressure': 1017.1,
'summary': 'Drizzle',
'temperature': 82.24,
'time': 1465776000,
'visibility': 10,
'windBearing': 74,
'windSpeed': 5.73},
{'apparentTemperature': 88.22,
'cloudCover': 0.88,
'dewPoint': 75,
'humidity': 0.8,
'icon': 'partly-cloudy-night',
'ozone': 283.36,
'precipIntensity': 0.0026,
'precipProbability': 0.08,
'precipType': 'rain',
'pressure': 1017.23,
'summary': 'Mostly Cloudy',
'temperature': 81.75,
'time': 1465779600,
'visibility': 10,
'windBearing': 74,
'windSpeed': 5.63},
{'apparentTemperature': 87.29,
'cloudCover': 0.86,
'dewPoint': 74.97,
'humidity': 0.81,
'icon': 'partly-cloudy-night',
'ozone': 284.47,
'precipIntensity': 0.0011,
'precipProbability': 0.02,
'precipType': 'rain',
'pressure': 1017.41,
'summary': 'Mostly Cloudy',
'temperature': 81.25,
'time': 1465783200,
'visibility': 10,
'windBearing': 74,
'windSpeed': 5.47},
{'apparentTemperature': 86.33,
'cloudCover': 0.83,
'dewPoint': 74.82,
'humidity': 0.82,
'icon': 'partly-cloudy-night',
'ozone': 285.64,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1017.41,
'summary': 'Mostly Cloudy',
'temperature': 80.78,
'time': 1465786800,
'visibility': 10,
'windBearing': 76,
'windSpeed': 5.18},
{'apparentTemperature': 85.46,
'cloudCover': 0.73,
'dewPoint': 74.65,
'humidity': 0.83,
'icon': 'partly-cloudy-night',
'ozone': 287.02,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1017.1,
'summary': 'Mostly Cloudy',
'temperature': 80.36,
'time': 1465790400,
'visibility': 10,
'windBearing': 84,
'windSpeed': 4.64},
{'apparentTemperature': 79.93,
'cloudCover': 0.59,
'dewPoint': 74.39,
'humidity': 0.83,
'icon': 'partly-cloudy-night',
'ozone': 288.46,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1016.63,
'summary': 'Partly Cloudy',
'temperature': 79.93,
'time': 1465794000,
'visibility': 10,
'windBearing': 97,
'windSpeed': 4.04},
{'apparentTemperature': 79.35,
'cloudCover': 0.47,
'dewPoint': 73.99,
'humidity': 0.84,
'icon': 'partly-cloudy-night',
'ozone': 289.59,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1016.18,
'summary': 'Partly Cloudy',
'temperature': 79.35,
'time': 1465797600,
'visibility': 10,
'windBearing': 110,
'windSpeed': 3.48},
{'apparentTemperature': 78.55,
'cloudCover': 0.4,
'dewPoint': 73.42,
'humidity': 0.84,
'icon': 'partly-cloudy-night',
'ozone': 290.09,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1015.78,
'summary': 'Partly Cloudy',
'temperature': 78.55,
'time': 1465801200,
'visibility': 10,
'windBearing': 116,
'windSpeed': 2.54},
{'apparentTemperature': 77.69,
'cloudCover': 0.36,
'dewPoint': 72.77,
'humidity': 0.85,
'icon': 'partly-cloudy-night',
'ozone': 290.27,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1015.41,
'summary': 'Partly Cloudy',
'temperature': 77.69,
'time': 1465804800,
'visibility': 10,
'windBearing': 117,
'windSpeed': 1.29},
{'apparentTemperature': 77,
'cloudCover': 0.33,
'dewPoint': 72.21,
'humidity': 0.85,
'icon': 'partly-cloudy-night',
'ozone': 290.69,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1015.24,
'summary': 'Partly Cloudy',
'temperature': 77,
'time': 1465808400,
'visibility': 10,
'windBearing': 109,
'windSpeed': 0.28},
{'apparentTemperature': 76.68,
'cloudCover': 0.32,
'dewPoint': 71.97,
'humidity': 0.85,
'icon': 'partly-cloudy-night',
'ozone': 291.53,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1015.4,
'summary': 'Partly Cloudy',
'temperature': 76.68,
'time': 1465812000,
'visibility': 10,
'windBearing': 332,
'windSpeed': 0.27},
{'apparentTemperature': 77.58,
'cloudCover': 0.31,
'dewPoint': 72.84,
'humidity': 0.85,
'icon': 'partly-cloudy-day',
'ozone': 292.6,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1015.74,
'summary': 'Partly Cloudy',
'temperature': 77.58,
'time': 1465815600,
'visibility': 10,
'windBearing': 343,
'windSpeed': 0.58},
{'apparentTemperature': 79.05,
'cloudCover': 0.28,
'dewPoint': 73.89,
'humidity': 0.84,
'icon': 'partly-cloudy-day',
'ozone': 293.89,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1016.09,
'summary': 'Partly Cloudy',
'temperature': 79.05,
'time': 1465819200,
'visibility': 10,
'windBearing': 359,
'windSpeed': 0.97},
{'apparentTemperature': 86.26,
'cloudCover': 0.2,
'dewPoint': 74.49,
'humidity': 0.81,
'icon': 'clear-day',
'ozone': 295.58,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1016.49,
'summary': 'Clear',
'temperature': 80.83,
'time': 1465822800,
'visibility': 10,
'windBearing': 9,
'windSpeed': 1.75},
{'apparentTemperature': 89.46,
'cloudCover': 0.1,
'dewPoint': 74.62,
'humidity': 0.77,
'icon': 'clear-day',
'ozone': 297.49,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1016.9,
'summary': 'Clear',
'temperature': 82.62,
'time': 1465826400,
'visibility': 10,
'windBearing': 16,
'windSpeed': 2.89},
{'apparentTemperature': 91.94,
'cloudCover': 0.07,
'dewPoint': 74.67,
'humidity': 0.73,
'icon': 'clear-day',
'ozone': 299.04,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1017.11,
'summary': 'Clear',
'temperature': 84.15,
'time': 1465830000,
'visibility': 10,
'windBearing': 26,
'windSpeed': 3.72},
{'apparentTemperature': 94.24,
'cloudCover': 0.21,
'dewPoint': 74.95,
'humidity': 0.71,
'icon': 'clear-day',
'ozone': 300.07,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1016.91,
'summary': 'Clear',
'temperature': 85.5,
'time': 1465833600,
'visibility': 10,
'windBearing': 44,
'windSpeed': 4.01},
{'apparentTemperature': 96.86,
'cloudCover': 0.4,
'dewPoint': 75.52,
'humidity': 0.69,
'icon': 'partly-cloudy-day',
'ozone': 300.75,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1016.44,
'summary': 'Partly Cloudy',
'temperature': 86.89,
'time': 1465837200,
'visibility': 10,
'windBearing': 65,
'windSpeed': 4.23},
{'apparentTemperature': 98.92,
'cloudCover': 0.51,
'dewPoint': 76.11,
'humidity': 0.68,
'icon': 'partly-cloudy-day',
'ozone': 301.08,
'precipIntensity': 0,
'precipProbability': 0,
'pressure': 1015.87,
'summary': 'Partly Cloudy',
'temperature': 87.83,
'time': 1465840800,
'visibility': 10,
'windBearing': 84,
'windSpeed': 4.78},
{'apparentTemperature': 97.72,
'cloudCover': 0.49,
'dewPoint': 75.87,
'humidity': 0.69,
'icon': 'partly-cloudy-day',
'ozone': 300.81,
'precipIntensity': 0.0017,
'precipProbability': 0.04,
'precipType': 'rain',
'pressure': 1015.22,
'summary': 'Partly Cloudy',
'temperature': 87.2,
'time': 1465844400,
'visibility': 10,
'windBearing': 97,
'windSpeed': 6.05},
{'apparentTemperature': 95.71,
'cloudCover': 0.39,
'dewPoint': 75.57,
'humidity': 0.71,
'icon': 'partly-cloudy-day',
'ozone': 300.19,
'precipIntensity': 0.0041,
'precipProbability': 0.15,
'precipType': 'rain',
'pressure': 1014.56,
'summary': 'Partly Cloudy',
'temperature': 86.07,
'time': 1465848000,
'visibility': 10,
'windBearing': 107,
'windSpeed': 7.51},
{'apparentTemperature': 93.4,
'cloudCover': 0.34,
'dewPoint': 75.14,
'humidity': 0.73,
'icon': 'rain',
'ozone': 299.99,
'precipIntensity': 0.0064,
'precipProbability': 0.28,
'precipType': 'rain',
'pressure': 1014.14,
'summary': 'Drizzle',
'temperature': 84.83,
'time': 1465851600,
'visibility': 10,
'windBearing': 114,
'windSpeed': 8.48}]
In [61]:
for cloudcover in data['hourly']['data']:
if cloudcover['cloudCover'] > 0.5:
print(cloudcover['temperature'], "and cloudy")
else:
print(cloudcover['temperature'])
80.41
81.49 and cloudy
81.18 and cloudy
80.49 and cloudy
80.2 and cloudy
79.92 and cloudy
79.64 and cloudy
79.26 and cloudy
78.65 and cloudy
77.69 and cloudy
77 and cloudy
76.61 and cloudy
76.11 and cloudy
76.92 and cloudy
78.23 and cloudy
79.78 and cloudy
81.33 and cloudy
82.77 and cloudy
84.42 and cloudy
85.74 and cloudy
86.83 and cloudy
86.36 and cloudy
86.12 and cloudy
84.97 and cloudy
84.35 and cloudy
83.52 and cloudy
82.78 and cloudy
82.24 and cloudy
81.75 and cloudy
81.25 and cloudy
80.78 and cloudy
80.36 and cloudy
79.93 and cloudy
79.35
78.55
77.69
77
76.68
77.58
79.05
80.83
82.62
84.15
85.5
86.89
87.83 and cloudy
87.2
86.07
84.83
7) What was the temperature in Central Park on Christmas Day, 1980? How about 1990? 2000? Tip: You'll need to use UNIX time, which is the number of seconds since January 1, 1970. Google can help you convert a normal date! Tip: You'll want to use Forecast.io's "time machine" API at https://developer.forecast.io/docs/v2
In [81]:
import requests
In [82]:
response = requests.get("https://api.forecast.io/forecast/94bc3fa3628bfad686b10e7054c67f71/40.7141667, -74.0063889,346550400")
data = response.json()
print(data['currently']['temperature'])
33.1
In [83]:
response = requests.get("https://api.forecast.io/forecast/94bc3fa3628bfad686b10e7054c67f71/40.7141667, -74.0063889,662083200")
data = response.json()
print(data['currently']['temperature'])
36.45
In [84]:
response = requests.get("https://api.forecast.io/forecast/94bc3fa3628bfad686b10e7054c67f71/40.7141667, -74.0063889,977702400")
data = response.json()
print(data['currently']['temperature'])
22.19
In [ ]:
Content source: sz2472/foundations-homework
Similar notebooks: