In [ ]:
import sqlite3
import pandas as pd
import savantscraper
# Example for two years and two teams
savantscraper.database_import('baseball_savant',
(2017, 2018),
teams=['STL', 'COL'])
In [ ]:
# Connect to the database
conn = sqlite3.connect('baseball_savant.db')
# Query the database and load into a pandas dataframe
df = pd.read_sql_query("select player_name, vx0 from statcast limit 5;", conn)
# Close connection when finished
conn.close()
df
In [ ]: