Background Jack loves the PlanMyTrip app. Beta testers love it too. And, as with any new product, they’ve recommended a few changes to take the app to the next level. Specifically, they recommend...

1 answer below »

Background


Jack loves the PlanMyTrip app. Beta testers love it too. And, as with any new product, they’ve recommended a few changes to take the app to the next level. Specifically, they recommend adding the weather description to the weather data you’ve already retrieved in this module. Then, you'll have the beta testers use input statements to filter the data for their weather preferences, which will be used to identify potential travel destinations and nearby hotels. From the list of potential travel destinations, the beta tester will choose four cities to create a travel itinerary. Finally, using the Google Maps Directions API, you will create a travel route between the four cities as well as a marker layer map.


What You're Creating


This new assignment consists of three technical analyses. You will submit the following deliverables:



  • Deliverable 1: Retrieve Weather Data

  • Deliverable 2: Create a Customer Travel Destinations Map

  • Deliverable 3: Create a Travel Itinerary Map


Files


Use the following links to download the Challenge starter codes.



Download Deliverable 2 starter code(Links to an external site.)



Download Deliverable 3 starter code(Links to an external site.)


Deliverable 1: Retrieve Weather Data (25 points)


Deliverable 1 Instructions


Generate a set of 2,000 random latitudes and longitudes, retrieve the nearest city, and perform an API call with the OpenWeatherMap. In addition to the city weather data you gathered in this module, use your API skills to retrieve the current weather description for each city. Then, create a new DataFrame containing the updated weather data.


REWIND

For this deliverable, you’ve already done the following in this module:





  1. Create a folder called Weather_Database.




  2. Create a new Jupyter Notebook file to retrieve the weather data, and name itWeather_Database.ipynb.




  3. Create a new set of 2,000 random latitudes and longitudes.




  4. Get the nearest city using thecitipymodule.




  5. Perform an API call with the OpenWeatherMap.




  6. Retrieve the following information from the API call:



    • Latitude and longitude

    • Maximum temperature

    • Percent humidity

    • Percent cloudiness

    • Wind speed

    • Weather description (for example, clouds, fog, light rain, clear sky)




  7. Add the data to a new DataFrame.



    • Before exporting your new DataFrame as a CSV file, take a moment to confirm that it looks similar to the image below:



    The new cities_data DataFrame summarizes the current weather description.




  8. Export the DataFrame as a CSV file, and save it asWeatherPy_Database.csvin the Weather_Database folder.




Deliverable 1 Requirements


You will earn a perfect score for Deliverable 1 by completing all requirements below:




  • Retrieve all of the following information from the API call:(15 pt)



    • Latitude and longitude

    • Maximum temperature

    • Percent humidity

    • Percent cloudiness

    • Wind speed

    • Weather description (for example, clouds, fog, light rain, clear sky)




  • Add the weather data to a new DataFrame(5 pt)




  • Export the DataFrame asWeatherPy_Database.csvinto the Weather_Database folder(5 pt)




Be sure to double-check that you have the following in the Weather_Database folder:



  • TheWeather_Database.ipynbfile

  • TheWeatherPy_Database.csvfile


Deliverable 2: Create a Customer Travel Destinations Map (35 points)


Deliverable 2 Instructions


Use input statements to retrieve customer weather preferences, then use those preferences to identify potential travel destinations and nearby hotels. Then, show those destinations on a marker layer map with pop-up markers.


REWIND

For this deliverable, you’ve already done the following in this module:





  1. Create a folder called Vacation_Search.




  2. Download theVacation_Search_starter_code.ipynbfile into your Vacation_Search folder, and rename itVacation_Search.ipynb.




  3. In theVacation_Search.ipynbfile, make sure the dependencies and API keys are imported correctly.




  4. Use the instructions below to add code where indicated by the numbered-step comments in the starter code file.




  5. In Step 1, import theWeatherPy_Database.csvfile from your Weather_Database folder from Deliverable 1 as a DataFrame.




  6. In Step 2, write two input statements that prompt the user to enter their minimum and maximum temperature criteria for their vacation.




  7. In Step 3, use thelocmethod to filter thecity_data_dfDataFrame for temperature criteria collected in Step 2, then create a new DataFrame.




  8. In Steps 4a-b, determine if there are any empty rows, then drop them if necessary and create a new DataFrame.




  9. In Steps 5a-b, use the provided code to create a new DataFrame,hotel_df, that will hold the hotel names from the hotel search in Steps 6a-6f.




  10. In Step 6a, we have supplied the search parameters, which are the same as in this module, that you’ll need to use to search for a hotel for each city in Steps 6b-f.




  11. In Steps 6b-f, iterate through thehotel_dfDataFrame, retrieve the latitude and longitude of each city to find the nearest hotel based on the search parameters from Step 6a, then add the hotel name to thehotel_dfDataFrame. If a hotel isn't found, skip to the next city.




  12. In Step 7, drop any rows in thehotel_dfDataFrame where a hotel name is not found.



    • Before exporting your DataFrame as a CSV, take a moment to confirm that your hotel_df DataFrame looks similar to the image below.



    The new hotel DataFrame has the Hotel Name column completed where hotels are found.




  13. In Steps 8a-b, create an output file to store thehotel_dfDataFrame asWeatherPy_vacation.csvin the Vacation_Search folder.




  14. In Step 9, add the city name, the country code, the weather description, and the maximum temperature for the city to theinfo_box_templateformat template we have provided.




  15. In Step 10a, use the provided list comprehension code to retrieve the city data from each row, which will then be added to the formatting template and saved in thehotel_infolist.




  16. In Step 10b, use the provided code snippet to retrieve the latitude and longitude from each row and store them in a new DataFrame.




  17. In Steps 11a-b, refactor your previous marker layer map code to create a marker layer map that will have pop-up markers for each city on the map.




  18. Take a screenshot of your map and save it to the Vacation_Search folder asWeatherPy_vacation_map.png.



    • The marker layer map with a pop-up marker for each city should look similar to the following image:



    The new hotel DataFrame includes pop-up markers for each city.




Deliverable 2 Requirements


You will earn a perfect score for Deliverable 2 by completing all requirements below:



  • Input statements are written to prompt the customer for their minimum and maximum temperature preferences.(5 pt)

  • A new DataFrame is created based on the minimum and maximum temperature, and empty rows are dropped.(5 pt)

  • The hotel name is retrieved and added to the DataFrame, and the rows that don’t have a hotel name are dropped.(10 pt)

  • The DataFrame is exported as a CSV file into the Vacation_Search folder and is saved asWeatherPy_vacation.csv.(5 pt)

  • A marker layer map with pop-up markers for the cities in the vacation DataFrame is created, and it is uploaded as a PNG. Each marker has the following information:(5 pt)

    • Hotel name

    • City

    • Country

    • Current weather description with the maximum temperature



  • The marker layer map is saved and uploaded to the Vacation_Search folder asWeatherPy_vacation_map.png.(5 pt)


Be sure to double-check that you have the following in the Vacation_Search folder:



  • TheVacation_Search.ipynbfile

  • TheWeatherPy_vacation.csvfile

  • TheWeatherPy_vacation_map.pngimage


Deliverable 3: Create a Travel Itinerary Map (40 points)


Deliverable 3 Instructions


Use the Google Directions API to create a travel itinerary that shows the route between four cities chosen from the customer’s possible travel destinations. Then, create a marker layer map with a pop-up marker for each city on the itinerary.


REWIND

For this deliverable, you’ve already done the following in this module:





  1. Enable the "Directions API" in your Google account for your API key.



    • On the Google Cloud Platform, select "APIs & Services" from the left-hand side



    Viewing the options on the Google Cloud Platform



    • Then, select "Library".



     Viewing the API Library on your Google Account



    • In the Search field, type "Directions".



     Viewing the API search field on your Google Account.



    • Select "Directions API".



    Search for the Directions API in the search field on your Google Account.



    • Click "Enable" to activate the Directions API.



     Viewing the APIs on your Google Account.




  2. Create a folder called Vacation_Itinerary.




  3. Download theVacation_Itinerary_starter_code.ipynbfile into your Vacation_Itinerary folder and rename itVacation_Itinerary.ipynb.




  4. In theVacation_Itinerary.ipynbfile, make sure the dependencies and API keys are imported.




  5. Use the instructions below to add code where indicated by the numbered-step comments in the starter code file.




  6. In Step 1, import theWeatherPy_vacation.csvfile from your Vacation_Search folder from Deliverable 2 as a DataFrame.




  7. In Steps 2-4, copy or refactor the code from Steps 11a-b of Deliverable 2 to create a marker layer map of the vacation search results.




  8. From the vacation search map,choose four citiesthat a customer might want to visit. They should be close together and in the same country.



    • You may have to refine your search with different weather criteria to get cities that are close together.




  9. In Step 5, use the variables we have provided and thelocmethod to create separate DataFrames for each city on the travel route.





Hint:You will start and end the route in the same city, so thevacation_startandvacation_endDataFrames will be the same city.



  1. In Step 6, use theto_numpy()function and list indexing to write code to retrieve the latitude-longitude pairs as tuples from each city DataFrame.


If you’d like a hint on using theto_numpy()function with list indexing, that’s totally okay. If not, that’s great too. You can always revisit this later if you change your mind.


HINT


  1. In Step 7, use thegmaps documentation(Links to an external site.)to create a directions layer map using the variables from Step 6, where the starting and ending city are the same city, thewaypointsare the three other cities, and thetravel_modeis either"DRIVING","BICYCLING", or"WALKING".




  2. Take a screenshot of your map from Step 7 and save it to the Vacation_Itinerary folder asWeatherPy_travel_map.png.



    • The directions layer map should look similar to the following image:





The directions layer for the vacation route.



  1. In Step 8, use the providedconcat()function code snippet to combine the four separate city DataFrames into one DataFrame.


If you’d like a hint on combining DataFrames into one DataFrame using theconcat()function, that’s totally okay. If not, that’s great too. You can always revisit this later if you change your mind.


HINT


  1. In Steps 9-11, refactor the code from Steps 2-4 to create a new marker layer map of the cities on the travel route.




  2. Take a screenshot of your map and save it to the Vacation_Itinerary folder asWeatherPy_travel_map_markers.png.



    • The marker layer map with a pop-up marker for each city should look similar to the following image:





The pop-up marker for each city for the vacation route.


Deliverable 3 Requirements


You will earn a perfect score for Deliverable 3 by completing all requirements below:



  • Four DataFrames are created, one for each city on the itinerary.(10 pt)

  • The latitude and longitude pairs for each of the four cities are retrieved.(5 pt)

  • A directions layer map between the cities and the travel map is created and uploaded asWeatherPy_travel_map.png.(10 pt)

  • A DataFrame that contains thefourcities on the itinerary is created.(10 pt)

  • A marker layer map with a pop-up marker for the cities on the itinerary is created, and it is uploaded asWeatherPy_travel_map_markers.png. Each marker has the following information:(5 pt)

    • Hotel name

    • City

    • Country

    • Current weather description with the maximum temperature




Be sure to double-check that you have the following in the Vacation_Itinerary folder:



  • TheVacation_Itinerary.ipynbfile

  • TheWeatherPy_travel_map.pngimage

  • TheWeatherPy_travel_map_markers.pngimage


Submission


Once you’re ready to submit, make sure to check your work against the rubric to ensure you are meeting the requirements for this Challenge one final time. It’s easy to overlook items when you’re in the zone!


As a reminder, the deliverables for this Challenge are as follows:



  • Deliverable 1: Retrieve Weather Data

  • Deliverable 2: Create a Customer Travel Destinations Map

  • Deliverable 3: Create a Travel Itinerary Map


Upload the following to your WeatherPy GitHub repository:




  • The Weather_Database folder with the following:



    • TheWeather_Database.ipynbfile

    • TheWeatherPy_Database.csvfile




  • The Vacation_Search folder with the following:



    • TheVacation_Search.ipynbfile

    • TheWeatherPy_vacation.csvfile

    • TheWeatherPy_vacation_map.pngimage




  • The Vacation_Itinerary folder with the following:



    • TheVacation_Itinerary.ipynbfile

    • TheWeatherPy_travel_map.pngimage

    • TheWeatherPy_travel_map_markers.pngimage




  • A README.md that describes the purpose of the repository. Although there is no graded written analysis for this challenge, it is encouraged and good practice to add a brief description of your project.




IMPORTANT

Do not include yourconfig.pyfile in your submission.


If you’d like a hint on how to not include theconfig.pyfile when adding your files to your GitHub repository, that’s totally okay. If not, that’s great too. You can always revisit this later if you change your mind.


HINT

To submit your challenge assignment in Canvas, click Submit, then provide the URL of your WeatherPy GitHub repository for grading. Comments are disabled for graded submissions in BootCampSpot. If you have questions about your feedback, please notify your instructional staff or the Student Success Manager. If you would like to resubmit your work for an improved grade, you can use theRe-Submit Assignmentbutton to upload new links. You may resubmit up to 3 times for a total of 4 submissions.


IMPORTANT

Once you receive feedback on your Challenge, make any suggested updates or adjustments to your work. Then, add this week’s Challenge to your professional portfolio.


NOTE

You are allowed to miss up to two Challenge assignments and still earn your certificate. If you complete all Challenge assignments, your lowest two grades will be dropped. If you wish to skip this assignment, click Submit then indicate you are skipping by typing “I choose to skip this assignment” in the text box.


Rubric

Module-6 RubricModule-6 Rubric



























CriteriaRatingsPts
This criterion is linked to a learning outcomeDeliverable 1: Retrieve Weather Data










25to >21.0PtsMastery✓The deliverable fulfills the “Emerging” criteria AND the following: ✓All the weather data is added to a new DataFrame. ✓The DataFrame is exported and saved as a CSV.21to >18.0PtsApproaching Mastery✓The deliverable fulfills the “Emerging” criteria AND the following: ✓All the weather data is added to a new DataFrame. ✓Code is written to export the DataFrame as a CSV, but there is an error to save it.18to >15.0PtsProgressing✓The deliverable fulfills the “Emerging” criteria AND the following: ✓Most of the weather data is added to a new DataFrame.15to >0.0PtsEmerging✓All of the required data from the API is retrieved.0PtsIncomplete

25pts

This criterion is linked to a learning outcomeDeliverable 2: Create a Customer Travel Destinations Map










35to >32.0PtsMastery✓Input statements are written to get the minimum and maximum temperature. ✓A new DataFrame is created based on the weather criteria, and empty rows are dropped. ✓The hotel name is added to the DataFrame, and the empty rows are dropped. ✓The DataFrame is exported and saved as a CSV file. ✓A marker layer map is created with a pop-up marker for each city that has all the correct data. ✓The marker layer map is saved as a PNG32to >27.0PtsApproaching Mastery✓Input statements are written to get the minimum and maximum temperature. ✓A new DataFrame is created based on the weather criteria, and empty rows are dropped. ✓The hotel name is added to the DataFrame, and the empty rows are dropped. ✓The DataFrame is exported and saved as a CSV file. ✓A marker layer map is created with a pop-up marker for each city, but some cities don’t have all the data. ✓The marker layer map is saved as a PNG27to >24.0PtsProgressing✓Input statements are written to get the minimum and maximum temperature. ✓A new DataFrame is created based on the weather criteria, and empty rows are dropped. ✓The hotel name is added to the DataFrame, but the empty rows are not dropped. ✓The DataFrame is exported and saved as a CSV file. ✓A marker layer map is created with a pop-up marker for each city, but some cities don’t have all the data. ✓The marker layer map is saved as a PNG24to >0.0PtsEmerging✓Input statements are written to get the minimum and maximum temperature. ✓A new DataFrame is created based on the weather criteria, but the empty rows are not dropped. ✓The hotel name is added to the DataFrame, but the empty rows are not dropped. ✓The DataFrame is exported and saved as a CSV file. ✓A marker layer map is created with a pop-up marker for each city, but some cities don’t have all the data. ✓The marker layer map is saved as a PNG0PtsIncomplete

35pts

This criterion is linked to a learning outcomeDeliverable 3: Create a Travel Itinerary Map










40to >36.0PtsMastery✓Four DataFrames are created, one for each city in the itinerary. ✓The latitude and longitude pairs for each city are retrieved to create the directions layer map. ✓A directions layer map between the cities and the travel map is uploaded as a PNG. ✓A DataFrame that contains the four cities on the itinerary is created. ✓A marker layer map with a pop-up marker for the cities in the itinerary is created, and is uploaded as a PNG.36to >34.0PtsApproaching Mastery✓Four DataFrames are created, one for each city in the itinerary. ✓The latitude and longitude pairs for each city are retrieved to create the directions layer map. ✓There is a directions layer map between THREE of the FOUR cities, and the travel map is uploaded as a PNG. ✓A DataFrame that contains the four cities on the itinerary is created. ✓A marker layer map with a pop-up marker for the cities in the itinerary is created, and is uploaded as a PNG.34to >31.0PtsProgressing✓Four DataFrames are created, one for each city in the itinerary. ✓The latitude and longitude pairs for each city are retrieved to create the directions layer map. ✓There is a directions layer map between TWO of the FOUR cities, and the travel map is uploaded as a PNG. ✓A DataFrame that contains the four cities on the itinerary is created. ✓A marker layer map with a pop-up marker for the cities in the itinerary is created, and is uploaded as a PNG.31to >0.0PtsEmerging✓Four DataFrames are created, one for each city in the itinerary. ✓Code is written to retrieve the latitude and longitude pairs for each of the four cities. ✓Code is written but a directions layer map isn’t created between the cities. ✓A DataFrame that contains the four cities on the itinerary is created. ✓A marker layer map with a pop-up marker for the cities in the itinerary is created, and is uploaded as a PNG.0PtsIncomplete

40pts

Total points:100

6.5.4: Map Vacation Criteria" style="float: left;">Previous
Module 6 Career Connection" style="float: right;">Next© 2020 - 2021 Trilogy Education Services, a 2U, Inc. brand. All Rights Reserved.
Answered Same DayDec 10, 2021

Answer To: Background Jack loves the PlanMyTrip app. Beta testers love it too. And, as with any new product,...

Sandeep Kumar answered on Dec 10 2021
119 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here