Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Tyler Burch tjburch

🏠
Working from home
View GitHub Profile
@tjburch
tjburch / baseball-data-in-julia
Last active Jun 19, 2022
Using interoperability to load baseball data into Julia
View baseball-data-in-julia
# For pybaseball (https://github.com/jldbc/pybaseball)
using DataFrames, PyCall, CSV
pybaseball = pyimport("pybaseball")
python_df = pybaseball.statcast("2021-04-06")
julia_df = CSV.read(IOBuffer(python_df.to_csv()), DataFrame)
# For baseballr (https://billpetti.github.io/baseballr/)
using RCall
@rlibarary baseballr
julia_df = rcopy(R"baseballr::scrape_statcast_savant(start_date = '2021-04-06', end_date = '2021-04-06')"