Skip to content

Create a Python script using API calls to visualize the weather of over 500 cities of varying distances from the equator. Utilize regression model to plan future vacations.

License

Notifications You must be signed in to change notification settings

thaychansy/python-api

Repository files navigation

Python API Challenge

Table of Contents

  1. About The Project
  2. Built With Python and Jupyter Notebook Framework
  3. Contributing (UC Berkeley Bootcamp Students Only)
  4. Contact
  5. Acknowledgments

About The Project

Background

Data's true power is its ability to definitively answer questions. So, let's take what you've learned about Python requests, APIs, and JSON traversals to answer a fundamental question: "What is the weather like as we approach the equator?"

Now, we know what you may be thinking: “That’s obvious. It gets hotter.” But, if pressed for more information, how would you prove that?

Instructions

This activity is broken down into two deliverables, WeatherPy and VacationPy.

Part 1: WeatherPy

In this deliverable, you'll create a Python script to visualize the weather of over 500 cities of varying distances from the equator. You'll use the citipy Python libraryLinks to an external site., the OpenWeatherMap APILinks to an external site., and your problem-solving skills to create a representative model of weather across cities.

For this part, you'll use the WeatherPy.ipynb Jupyter notebook provided in the starter code ZIP file. The starter code will guide you through the process of using your Python coding skills to develop a solution to address the required functionalities.

To get started, the code required to generate random geographic coordinates and the nearest city to each latitude and longitude combination is provided.

Requirement 1: Create Plots to Showcase the Relationship Between Weather Variables and Latitude

To fulfill the first requirement, you'll use the OpenWeatherMap API to retrieve weather data from the cities list generated in the starter code. Next, you'll create a series of scatter plots to showcase the following relationships:

  • Latitude vs. Temperature

  • Latitude vs. Humidity

  • Latitude vs. Cloudiness

  • Latitude vs. Wind Speed

Requirement 2: Compute Linear Regression for Each Relationship

You should create the following plots:

image

  • Northern Hemisphere: Temperature vs. Latitude

  • Southern Hemisphere: Temperature vs. Latitude

  • Northern Hemisphere: Humidity vs. Latitude

  • Southern Hemisphere: Humidity vs. Latitude

  • Northern Hemisphere: Cloudiness vs. Latitude

  • Southern Hemisphere: Cloudiness vs. Latitude

  • Northern Hemisphere: Wind Speed vs. Latitude

  • Southern Hemisphere: Wind Speed vs. Latitude

After each pair of plots, explain what the linear regression is modeling. Describe any relationships that you notice and any other findings you may uncover.

Part 2: VacationPy

In this deliverable, you'll use your weather data skills to plan future vacations. Also, you'll use Jupyter notebooks, the geoViews Python library, and the Geoapify API.

The code needed to import the required libraries and load the CSV file with the weather and coordinates data for each city created in Part 1 is provided to help you get started.

Your main tasks will be to use the Geoapify API and the geoViews Python library and employ your Python skills to create map visualizations.

To succeed on this deliverable of the assignment, open the VacationPy.ipynb starter code and complete the following steps:

  1. Create a map that displays a point for every city in the city_data_df DataFrame as shown in the following image. The size of the point should be the humidity in each city.

image

  1. Narrow down the city_data_df DataFrame to find your ideal weather condition. For example:
  • A max temperature lower than 27 degrees but higher than 21

  • Wind speed less than 4.5 m/s

  • Zero cloudiness

    image

(back to top)

Built with Python and Jupyter Notebook Framework

Python Citipy Library, OpenWeatherMapAPI, and Juypter Notebook platform was the framework used for this project.

(back to top)

Contributing

(UC Berkeley Bootcamp Students Only)

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".

Don't forget to give the project a star! Thanks again!

  1. Fork the Project

  2. Create your Feature Branch (git checkout -b new-branch-name)

  3. Commit your Changes (git commit -m 'Add some message')

  4. Push to the Branch (git push origin new-branch-name)

  5. Create a pull request.

Forking a repository and creating a pull request on GitHub is a great way to contribute to open-source projects. Here's a breakdown of the process:

  1. Forking the Repository:

Find the repository you want to contribute to on GitHub. Click on the "Fork" button in the top right corner. This creates a copy of the repository in your own account.

  1. Clone the Forked Repository to Your Local Machine

You'll need Git installed on your system. Use Git commands to clone your forked repository to your local machine. There will be instructions on the GitHub repository page for cloning.

  1. Making Changes (Local Work):

Make your changes to the code in your local copy. Use Git commands to track your changes (adding, committing).

  1. Pushing Changes to Your Fork:

Once you're happy with your changes, use Git commands to push your local commits to your forked repository on GitHub.

  1. Creating a Pull Request:

Go to your forked repository on GitHub. Click the "Compare & pull request" button (might appear as a yellow banner). Here, you'll see a comparison between your changes and the original repository. Write a clear title and description for your pull request explaining the changes you made. Click "Create Pull Request" to submit it for review.

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Thay Chansy - @thaychansy - or thay.chansy@gmail.com

Please visit my Portfolio Page: thaychansy.github.io

Project Link: thaychansy/python-api-challenge

(back to top)

Acknowledgments

Here's a list of resources we found helpful and would like to give credit to.

(back to top)

About

Create a Python script using API calls to visualize the weather of over 500 cities of varying distances from the equator. Utilize regression model to plan future vacations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published