GithubHelp home page GithubHelp logo

frankt86 / nflfastpy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bendominguez0111/nflfastpy

0.0 0.0 0.0 1.06 MB

Python package for loading nflfastR play by play data

License: MIT License

Python 100.00%

nflfastpy's Introduction

nflfastpy

This is a Python package for easily loading NFL play by play data via nflfastR

Installing nflfastpy

nflfastpy is available on PyPI

$ pip install nflfastpy

nflfastpy supports Python 3.6+

Usage

Loading Play by Play Data

Play by play data is available going back to 1999.

import nflfastpy

df = nflfastpy.load_pbp_data(year=2020)

Loading Roster Data

Roster data comes with player headshots. Rookies are not included in roster data as roster data is only available up to 2019. To account for this, a variable is available in the module called nflfastpy.default_headshot that is a numpy array representation of a default player headshot.

roster_df = nflfastpy.load_roster_data()

Joining Roster Data and Team Logo Data with Play by Play Data

To join roster data with play by play data, player id's in the play by play data must be converted to the old GSIS ID. The helper function in nflfastpy.utils.convert_to_gsis_id accomplishes this. Check out the file named "Roster Data and Team Logo Data.ipynb" under the examples folder to see how to use the function.

Loading Schedule Data

Schedule data is available from 1999 to 2020.

schedule = nflfastpy.load_schedule_data(year=2020)

nflfastpy's People

Contributors

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