Git Product home page Git Product logo

nathanblumenfeld / collegebaseball Goto Github PK

View Code? Open in Web Editor NEW
31.0 3.0 9.0 68.01 MB

An open-source college baseball analysis package for Python. Includes functionality for data acquisition and calculation of advanced metrics.

Home Page: https://collegebaseball.readthedocs.io/en/latest/index.html

License: MIT License

Python 2.78% Jupyter Notebook 97.22%
sabermetrics baseball baseball-analytics ncaa sports sports-analytics baseball-statistics baseball-data

collegebaseball's Introduction

collegebaseball's People

Contributors

armstjc avatar benhowell71 avatar nathanblumenfeld avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

collegebaseball's Issues

Package install fails when running "pip install git+https://github.com/nathanblumenfeld/collegebaseball" on Visual Studio

Code output when run:

----- Installing 'git+https://github.com/nathanblumenfeld/collegebaseball' -----
Collecting git+https://github.com/nathanblumenfeld/collegebaseball
  Cloning https://github.com/nathanblumenfeld/collegebaseball to c:\users\xme10\appdata\local\temp\pip-req-build-p_5ph3sy
  Running command git clone --filter=blob:none --quiet https://github.com/nathanblumenfeld/collegebaseball 'C:\Users\xme10\AppData\Local\Temp\pip-req-build-p_5ph3sy'
  Resolved https://github.com/nathanblumenfeld/collegebaseball to commit 76746c4ceed6cde9406cbcc6e637df7b0e35147e
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: pandas in c:\program files (x86)\microsoft visual studio\shared\python39_64\lib\site-packages (from collegebaseball==1.0.0a0) (1.4.1)
Requirement already satisfied: numpy in c:\program files (x86)\microsoft visual studio\shared\python39_64\lib\site-packages (from collegebaseball==1.0.0a0) (1.22.3)
Requirement already satisfied: requests in c:\program files (x86)\microsoft visual studio\shared\python39_64\lib\site-packages (from collegebaseball==1.0.0a0) (2.27.1)
Requirement already satisfied: lxml in c:\program files (x86)\microsoft visual studio\shared\python39_64\lib\site-packages (from collegebaseball==1.0.0a0) (4.8.0)
Collecting bs4
  Using cached bs4-0.0.1-py3-none-any.whl
Collecting importlib
  Using cached importlib-1.0.4.zip (7.1 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  python setup.py egg_info did not run successfully.
  exit code: 1
  
  [1 lines of output]
  ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
  [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
----- Failed to install 'git+https://github.com/nathanblumenfeld/collegebaseball' -----

2023 Hitting and Pitching Split Stat IDs

available_stat_id = ncaa_utils.available_stat_ids[variant][season][split] currently fails for 2023 split stats. I pulled the NCAA's split stat IDs in a dictionary format.

batting:

 2023: {
  'two_outs': '17280',
  'vs_RH': '17281',
  'runners_on': '17286',
  'with_RISP': '17293',
  'vs_LH': '17288',
  'bases_empty': '17294',
  'bases_loaded': '17295'
}

pitching:

2023: {
  'runners_on': '17297',
  'vs_LH': '17298',
  'two_outs': '17299',
  'bases_empty': '17300',
  'with_RISP': '17301',
  'bases_loaded': '17304',
  'vs_RH': '17305'
}

TypeError: 'type' object is not subscriptable

Installed the package with pip. When trying to import the package in Juyter i get the following error. Is this m\on my end or an issue with the package?

import numpy as np from collegebaseball import * import pandas as pd import plotly.express as px import plotly.graph_objects as go from plotly.subplots import make_subplots import plotly.offline as pyo pyo.init_notebook_mode()

TypeError Traceback (most recent call last)
in
1 import numpy as np
----> 2 from collegebaseball import *
3 import pandas as pd
4 import plotly.express as px
5 import plotly.graph_objects as go

~/opt/anaconda3/lib/python3.8/site-packages/collegebaseball/init.py in
18 get_rosters_path, get_rosters_table,
19 get_season_linear_weights
---> 20 from .download_utils import download_rosters,
21 download_player_game_logs, download_season_rosters,
22 download_team_results, download_team_stats, \

~/opt/anaconda3/lib/python3.8/site-packages/collegebaseball/download_utils.py in
18
19
---> 20 def download_rosters(seasons: list[int], divisions: list[int], save=True):
21 res = pd.DataFrame()
22 failures = []

TypeError: 'type' object is not subscriptable

โ€‹

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.