Load the 7 day forecast from DarkSky.Net into Pandas!

In this example you will go back to https://api.darksky.net and use your API key to get the 7 day weather forecast for any input location.

First you will need to geocode the location to a Latitude and Lognitude. Please use the Python geocoder module for this: https://geocoder.readthedocs.io/

One you gave coordinates use the DarkSky api to get the 7 day forecast (it's the current conditions + 7 days out == 8 days total) for the location.

Extract the forecast data and load it into Pandas, then display the Time of the forecast, and high and low temperatures:

HINT: To get the times to show up in a human-readable format, you must convert the DarkSky API time (which is in unix timestamp format) to a Pandas Timestamp date/time format. The pd.to_datetime() function can help you:

time = 1489402800 # this the time format Darksky returns
readable_time = pd.to_datetime(time, unit='s') ## s stands for unix timestamp format
readable_time

Timestamp('2017-03-13 11:00:00')

Just replace the ['time'] column in the DataFrame with the new version.

Step 1: Problem Analysis for entire program

Inputs:

Outputs:

Algorithm (Steps in Program):


In [ ]:
# STEP 2: Todo write code here

In [19]:
# Here's my output from when I ran the solution, to give you an example of what I expect to see in Pandas  
# Input here was Syrcause, NY (lat=43.0481221, lng=-76.1474244) for example


Out[19]:
time temperatureMin temperatureMax
0 2017-03-13 04:00:00 8.74 25.01
1 2017-03-14 04:00:00 17.85 25.42
2 2017-03-15 04:00:00 15.93 22.90
3 2017-03-16 04:00:00 17.23 29.19
4 2017-03-17 04:00:00 17.25 36.15
5 2017-03-18 04:00:00 26.74 38.07
6 2017-03-19 04:00:00 25.69 32.82
7 2017-03-20 04:00:00 13.76 37.08

Step 3: Questions

  1. Pandas programs are different than typical Python programs. Explain the process you followed to achieve the solution?

Answer:

  1. What was the most difficult aspect of this assignment?

Answer:

Step 4: Reflection

Reflect upon your experience completing this assignment. This should be a personal narrative, in your own voice, and cite specifics relevant to the activity as to help the grader understand how you arrived at the code you submitted. Things to consider touching upon: Elaborate on the process itself. Did your original problem analysis work as designed? How many iterations did you go through before you arrived at the solution? Where did you struggle along the way and how did you overcome it? What did you learn from completing the assignment? What do you need to work on to get better? What was most valuable and least valuable about this exercise? Do you have any suggestions for improvements?

To make a good reflection, you should journal your thoughts, questions and comments while you complete the exercise.

Keep your response to between 100 and 250 words.

--== Write Your Reflection Below Here ==--


In [ ]: