Python for Time Series Forecasting
4h 20mIntermediate2025-07-17
Authors

Jesus Lopez
Course details
Learn practical time series forecasting with Python using real-world datasets from energy (EIA – U.S. Energy Information Administration) and economics (FRED – Federal Reserve Economic Data).
Build skills step by step, from loading and preprocessing time series data to decomposing trends and seasonality, visualizing patterns with Plotly, and applying forecasting models like ARIMA, SARIMA, exponential smoothing, and Prophet. Learn to evaluate model performance using error metrics and cross-validation techniques like walk-forward validation.
The course emphasizes hands-on exercises in a GitHub Codespaces environment, so you can immediately apply what you learn to your own datasets. Whether you’re working with sales, energy, or financial data, you’ll gain the skills to generate accurate, interpretable forecasts that drive real-world decisions.
Build skills step by step, from loading and preprocessing time series data to decomposing trends and seasonality, visualizing patterns with Plotly, and applying forecasting models like ARIMA, SARIMA, exponential smoothing, and Prophet. Learn to evaluate model performance using error metrics and cross-validation techniques like walk-forward validation.
The course emphasizes hands-on exercises in a GitHub Codespaces environment, so you can immediately apply what you learn to your own datasets. Whether you’re working with sales, energy, or financial data, you’ll gain the skills to generate accurate, interpretable forecasts that drive real-world decisions.
Skills covered
PythonData AnalysisProgramming LanguagesData ScienceBusiness Analysis and StrategyBusiness Software and ToolsOpen SourceSoftware DevelopmentOne-Off
Concepts
0. Introduction
- 01 - Why learn practical Python for time series forecasting
- 02 - How to use Codespaces
1. Foundations - Load and Preprocess Time Series Data Files
- 03 - Search and download Federal Reserve Economic Data
- 04 - Load CSV and set dtype as datetime
- 05 - Datetime components on different columns
- 06 - Why set the datetime column as index
- 07 - Load and preprocess data from Excel
2. Visualize Time Series Data
- 08 - Methods to visualize data with Python
- 09 - Python libraries for data visualization
- 10 - Set Plotly as pandas backend for plotting
- 11 - Customize default Plotly theme
- 12 - How to interpret different plot types
- 13 - Tricks to visualize multiple time series at once
3. Time Series Decomposition
- 14 - Decomposing California solar energy using data from EIA
- 15 - Data preprocessing for insightful decomposition
- 16 - Seasonal decompose with Statsmodels
- 17 - Interpret decomposition models - Additive vs. multiplicative
- 18 - Build DataFrame of components
- 19 - Compare models using Plotly interactive visualization
4. Assignment 1
- 20 - Download US energy data using Python with EIA API
- 21 - Configure a template notebook based on new datasets
- 22 - How to specify the aggregation rule and periods
- 23 - Using Copilot to interpret a visual report with AI
5. Model Time Series to Forecast - Baseline Models
- 24 - Intuition behind forecasting models
- 25 - Build DataFrame to gather forecasted future values
- 26 - Moving average method
- 27 - Seasonal naive method
6. Autoregressive Integrated Moving Average (ARIMA)
- 28 - Introduction to developing ARIMA models
- 29 - Fit mathematical equation model
- 30 - How ARIMA changes with parameters P, D, and Q
- 31 - Differencing to achieve stationarity
- 32 - ACF and PACF
- 33 - Playground to try different configurations
- 34 - Diagnostics to validate assumptions
- 35 - Summary - Important steps to consider in ARIMA modeling
7. Seasonal Autoregressive Integrated Moving Average (SARIMA)
- 36 - Introducing seasonal order with SARIMA model
- 37 - Model fit and forecast
- 38 - Diagnostics to validate assumptions
- 39 - Summary - From ARIMA to SARIMA
8. Data Stationarity
- 40 - How does stationarity look in a time series
- 41 - Log transformation to achieve data stationarity
- 42 - Reverse log transformation on forecasted data
- 43 - Data transformations to achieve stationarity
9. Metrics to Measure Model Performance
- 44 - Why use a metric that aggregates the residuals of a model
- 45 - Error metrics and steps to calculate
- 46 - Interpretation of metrics in business terms
10. Assignment 2
- 47 - Configure a template notebook based on new datasets
11. Exponential Smoothing Models
- 48 - SARIMA vs. exponential smoothing
- 49 - Model fit and forecast
- 50 - Understand model configurations based on playground
- 51 - Diagnostics to validate assumptions and inform model choice
12. Prophet Modeling
- 52 - Introduction to Prophet - A semi-automatic time series model
- 53 - Model fit step by step
- 54 - Feed holidays data into the model
- 55 - Data preprocessing to forecast and visualize values
- 56 - Configure seasonality parameters in Prophet
- 57 - How to interpret diagnostics with robust models
13. Evaluate and Compare Time Series Models - Train Test Split
- 58 - Why test on unseen data during model fit
- 59 - Train-test split for one model
- 60 - Evaluate multiple models at once
14. Assignment 3
- 61 - Configure a template notebook based on new datasets
15. Walk-Forward Validation
- 62 - Walk-forward validation as a more realistic choice
- 63 - Run a walk-forward experiment with multiple models
- 64 - How does TimeSeriesSplit work to produce walk-forward sets
Conclusion
- 65 - Next steps