GithubHelp home page GithubHelp logo

ootp-pt-analysis's Introduction

ootp-pt-analysis

How to generate a sheet - run python generate_sheet.py in the terminal and check the output folder.

To add columns to different sheets, see the analysis_sheet_headers.py file in the output_utils folder

To see how calculating babip works, look at the calculate_babip.py file.

ootp-pt-analysis's People

Contributors

paoloruiz avatar psymar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ootp-pt-analysis's Issues

Lefty/righty copy/paste errors

calculate_splits.py is riddled with copy/paste errors; particularly I noticed these in lines 27-34. I'll submit a pull request with this fix as well as a fix for the divide-by-zero issues I've been getting.

Divide by zero error in calculate_stats.py

Traceback (most recent call last):
File "C:\Users\johnm\Dropbox\ootp-pt-analysis\generate_sheet.py", line 47, in
splits = get_splits(ovr_data_ylt, vl_data_ylt, vr_data_ylt, vl_data, vr_data)
File "C:\Users\johnm\Dropbox\ootp-pt-analysis\stats\splits\calculate_splits.py", line 8, in get_splits
"fielder": sum(map(lambda gs_stats: gs_stats["gs"], fielder_full_time)) / len(fielder_full_time),
ZeroDivisionError: division by zero

I assume someone in one of my tournaments got used only as a DH, PH or PR and thus had no fielding data.
Easy enough to fix with "0 if len(variable)==0 else (quotient)", but has to be fixed for each fielding data line and catching line.

KeyError in calculate_stats

Traceback (most recent call last):
File "C:\Users\johnm\Dropbox\ootp-pt-analysis\generate_sheet.py", line 47, in
splits = get_splits(ovr_data_ylt, vl_data_ylt, vr_data_ylt, vl_data, vr_data)
File "C:\Users\johnm\Dropbox\ootp-pt-analysis\stats\splits\calculate_splits.py", line 2, in get_splits
catcher_full_time, catcher_vr, catcher_vl = _get_potential_catchers(ovr_data, vl_data_ylt, vr_data_ylt)
File "C:\Users\johnm\Dropbox\ootp-pt-analysis\stats\splits\calculate_splits.py", line 64, in _get_potential_catchers
if vl_data[year_league_team][pot_catchers[0]["CID"]]["gs"] > vl_data[year_league_team][pot_catchers[1]["cid"]]["gs"]:
KeyError: 'cid'

Fix is to change "cid" to "CID". PR incoming.

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.