Skip to content

In this example, you'll be creating a Python script to visualize the weather of 500+ cities across the world of varying distance from the equator. To accomplish this, you'll be utilizing a simple Python library, the OpenWeatherMap API, and a little common sense to create a representative model of weather across world cities.

Notifications You must be signed in to change notification settings

maivey/python-api-challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WeatherPy

Click here to go to the deployed project webpage.

A Python script that visualizes the weather of 500+ cities across the world of varying distance from the equator. To accomplish this, uses a simple Python library, the OpenWeatherMap API, to create a representative model of weather across world cities.

Prerequisites

This script requires imports of the following:

import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import requests
import time
from pprint import pprint
import datetime
from citipy import citipy

Import API key (must obtain an API key from OpenWeatherMap API)

from api_keys import api_key

Summary

Whether financial, political, or social -- data's true power lies in its ability to answer questions definitively. Using Python requests, APIs, and JSON traversals, this script answers a fundamental question: "What's the weather like as we approach the equator?"

Equator

This script builds a series of scatter plots to showcase the following relationships:

  • Temperature (F) vs. Latitude
  • Humidity (%) vs. Latitude
  • Cloudiness (%) vs. Latitude
  • Wind Speed (mph) vs. Latitude

The notebook does the following:

  • Randomly selects at least 500 unique (non-repeat) cities based on latitude and longitude.
  • Performs a weather check on each of the cities using a series of successive API calls.
  • Includse a print log of each city as it's being processed with the city number and city name.
  • Saves both a CSV of all data retrieved and png images for each scatter plot.

About

In this example, you'll be creating a Python script to visualize the weather of 500+ cities across the world of varying distance from the equator. To accomplish this, you'll be utilizing a simple Python library, the OpenWeatherMap API, and a little common sense to create a representative model of weather across world cities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published