pybaseball
pybaseball copied to clipboard
repeated warning when running pybaseball.statcast()
The following warning is raised once for each day in the query:
FutureWarning: errors='ignore' is deprecated and will raise in a future version. Use to_datetime without passing errors and catch exceptions explicitly instead
data_copy[column] = data_copy[column].apply(pd.to_datetime, errors='ignore', format=date_format)
The warning is worthwhile to keep, and can be suppressed in your implementation like so:
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore", FutureWarning)
df = statcast(...)