# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# # Homework: 7 Day Forecast
#
# ## The Problem
#
# For this assignment, use IPython interact so the user can input a location and then display the **current conditions** and the **7 day weather forecast** for that location. 
#
# To accomplish this, you will need a Weather API and a Geocoding API. I suggest using the example from lesson 10. OpenWeatherMap is a free service. Their OneCall API should be excatly what you need: https://openweathermap.org/api/one-call-api  The focus of this assignment is loading the 7-day forecast int a data frame and the manipulation of the data frame itself.
#
#
# ### Requirements:
#
# - Display all temperatures as integer values ( I don't want to see 34.67) in degrees Fahrenheight (imeprial units).
# - Make sure to show the weather icon for the current conditions: https://openweathermap.org/weather-conditions#How-to-get-icon-URL See example here, for code `10d`: http://openweathermap.org/img/wn/10d@2x.png
# - The 7 day forecast should display the Day of the week (Monday, Tuesday, etc...) plus the low and high temperatures for that day.
#
#
# ### Screenshot of an example run:
#
# ![Screenshot](https://i.imgur.com/MiSpxaT.png)
#
#
# HINTS and ADVICE:
#
#
# - Use the **problem simplification approach** solve a simpler problem and add complexity as you figure things out.
# - Hard-code a location. e.g. Syracuse, NY
# - Start with the weather example from lesson 10. The OneCall API should be excatly what you need: https://openweathermap.org/api/one-call-api 
# - For the `current conditions`, we only need the description weather icon and current temperature. Get that working next.
# - Next work on getting the 7-day to display in a data frame. 
# - Next work on setting the 7-day to display EXACTLY like the output. There are several approaches:
#    - You could iterate over the API output building another list of dict with exactly the values required and then displaying that in a data frame. 
#    - You could load the API output into a dataframe then use `to_records()` to iterate over the dataframe to build another data frame
#    - You could try to manipulate the dataframe with the `apply()` method an a lambda (inline function). This is probably the least amount of code but the most difficult to accomplish.
# - Once everything above works, introduce IPython interact and allow for the input of any location. You are done!
#

# + [markdown] label="problem_analysis_cell"
# ## Part 1: Problem Analysis
#
# Inputs:
#
# ```
# TODO: Inputs
# ```
#
# Outputs:
#
# ```
# TODO: Outputs
# ```
#
# Algorithm (Steps in Program):  
#
# ```
# TODO:Steps Here
#
# ```
# -

# ## Part 2: Code Solution
#
# You may write your code in several cells, but place the complete, final working copy of your code solution within this single cell below. Only the within this cell will be considered your solution. Any imports or user-defined functions should be copied into this cell. 

# + label="code_solution_cell"
# Step 2: Write code here


# + [markdown] label="homework_questions_cell"
# ## Part 3: Questions
#
# 1.Pandas programs are different than typical Python programs. Explain the process you followed to achieve the solution? Which approach did you take to the dataframe?
#
# `--== Double-Click and Write Your Answer Below This Line ==--`  
#
#
# 2. Did you use `json_normalize()` to flatten the dataframe?
#
# `--== Double-Click and Write Your Answer Below This Line ==--`  
#
#
# 3. This solution requires little new code was far from easy. This shows that more code != complex code.  Where did you spend most of your time on this assignment?
#
# `--== Double-Click and Write Your Answer Below This Line ==--`  
#
#
#

# + [markdown] label="reflection_cell"
# ## Part 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.
#
# `--== Double-Click and Write Your Reflection Below Here ==--`  
#
# -

# run this code to turn in your work!
from coursetools.submission import Submission
Submission().submit()

StarcoderdataJupyterScriptsDedupFiltered