Code Monkey home page Code Monkey logo

python_apis's Introduction

Python_APIs

Background

Creating a Python script to visualize the weather of 500+ cities across the world of varying distance from the equator using CityPy, a simple Python library, and the OpenWeatherMap API.

Objectives

Building 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

A Python script accomplishes 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.
  • Includes 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.

Observable Trends

  • Not surprisingly, temperature increases as we approach the equator. However, temperature peaks at around 20 degrees latitude, not exactly at the equatorial line. This may be due to the Earth's tilt in the axis known as obliquity.
  • Cloudiness and humidity do not show a strong correlation to latitude. The visualizations below show a great variety of values at similar latitudes.
  • Wind speed appears to slightly increase as we move away from the equator. We would need to go beyond the ranged examined to make a definitive conclusion.

Image

Generating Cities List

Image

Performing API Calls

  • Performing a weather check on each city using a series of successive API calls
  • Including a print log of each city as it's being processed (with the city number and city name)

Image

Converting Raw Data to DataFrame

Image Image Image Image

Plotting the Data

  • Using a proper labeling of the plots using plot titles (including date of analysis) and axes labels
  • Save the plotted figures as pngs

Latitude vs. Temperature Plot

Image

Latitude vs. Humidity Plot

Image

Latitude vs. Cloudiness Plot

Image

Latitude vs. Wind Speed Plot

Image

python_apis's People

Contributors

mserobabina avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.