Skip to content

loumishima/NFL-Data-Analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NFL - Data Analysis & Bar chart race

This project has the objective to gather NFL data from the NFL website, it is focused on the individual stats from the first Superbowl season (1966) until the last season played.

It mixes Python and R coding, being used mostly the BeautifulSoup library for the Web Scrapper and dplyr and ggplot2 libraries for the Data Analysis and visualisation

The video below shows the cumulative yards race among active and retired players over the years

alt text

Web Crawler Usage

For the data gathering on the Jupyter notebook, there are two parameters that have to be set on the function getNFLData:

  • Attribute: What kind of stats you want to gather, it could be:
    • Passing
    • Rushing
    • Receiving
    • Sacks
    • Touchdowns
    • and more (Check the Players stats)
  • Season type: Nfl's playing period
    • Offseason
    • Regular Season
    • Post-season and Superbowls

Bar Chart Race usage

For now the Bar chart race is not very user friendly, but to change the attribute being used for the race just change the Yds variable name for the stats of your desire:

More to come:

  1. Make a better interface to gather and create customs bar charts
  2. Integrating the two codes into one (Still too emotionally connected to R language haha)
  3. Or maybe two versions (with some language usage analysis)
  4. Create an web page for the data gathering

References

National Football League - NFL.com

Michael Toth - Creating a bar chart race in r

O'reilly - Web Scraping with Python

About

Algorithm to extract and visualise data from the NFL website

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors