Coder Social home page Coder Social logo

api-practice-paired-lab_htx-ds-111819's Introduction

API Practice - Paired Lab

Introduction

For some further practice with APIs (and with SQL!), we're going to work on a single big lab to apply what we've learned in Module 1!

The Goal

Start by examining the data dictionary for the SQL database we'll be working with, which comes from this kaggle page. Familiarize yourself with the tables it contains, and what each column means. We'll be using this database to get data on each soccer team and calculate some summary statistics.

Unlike previous labs, this lab is more open-ended. At minimum, you'll need to:

  • Query the SQL database
  • Calculate summary statistics
  • Get the weather data from the DarkSky API

Upon completion of this lab, you should be able to see/access the following information:

  • The name of the team
  • The total number of goals scored by the team during the 2011 season
  • The total number of wins the team earned during the 2011 season
  • The team's win percentage on days where it was raining (in Berlin) during games in the 2011 season.

The Data

You'll find a database containing information about soccer teams and the matches they've played in the file database.sqlite.

Getting the Weather Data

You'll need to figure out if it was raining or not during the game. The database itself does not contain this information, but it does contain the date on which the game was played. For this, you'll need to use the DarkSky API to get the historical weather data for that day.

Note that each game is played in a different location, and this information is not contained in our SQL database. However, the teams in this database are largely German, so go ahead and just use the weather in Berlin, Germany as a proxy for this information. If it was raining in Berlin on the day the game was played, count that as rain game-- you do not need to try and figure out the actual weather at each game's location, because we don't have that information!

NOTE: The DarkSky API is limited to 1000 free API calls a day, so be sure to test your model on very small samples. Otherwise, you'll hit the rate limit!

Some Advice

This is a paired afternoon lab, meant to take just one afternoon. You may run out of time, and that's okay! But do make sure to comment your code while you're writing it in case you don't have time today and want to go back later.

ALSO: It's okay to use external tools to make your life easier -- that's what they're for! Using tools like the DB Browser for SQLite to visualize and interact with your SQL database, or Postman to test your API query, is one aspect of working smarter (not harder)!

api-practice-paired-lab_htx-ds-111819's People

Contributors

lindseyberlin avatar mike-kane avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.