Practical Python for Time Series Analysis
3h 35mIntermediate2025-12-05
Authors

Jesus Lopez
Course details
Time series data drives critical decisions in finance, energy, and economics—but requires specialized skills. Full-stack data consultant and solutions architect Jesús López guides you through practical Python techniques, combining software engineering and statistical analysis using pandas, statsmodels, and plotly.
Work with real datasets from the Federal Reserve (FRED), PJM energy markets, and financial data to master essential skills: joining temporal datasets with different frequencies, aggregating data across time periods with groupby, creating pivot tables for comparisons, and resampling to match analysis needs.
Learn regression analysis for time series: fit OLS models, calculate R-squared from scratch to understand model quality, diagnose autocorrelation with Durbin-Watson tests, and apply HAC standard errors to correct inflated significance. Discover how temporal discretization and regime-specific modeling dramatically improve explanatory power when economic relationships change across periods.
Every technique is taught through hands-on examples with energy generation, economic indicators, and stock data—giving you immediately applicable skills for your temporal datasets.
Learning objectives
Preprocess time series data and create visualizations to highlight patterns and anomalies across time dimensions like minute, hour, weekday, and month.
Analyze and decompose time series into trend, seasonal, and irregular components to isolate and explain underlying drivers.
Use differencing and other techniques to reveal hidden relationships and reduce confounding factors in causal analysis.
Apply statistical models, including regression and correlation analysis, to quantify relationships and test causal hypotheses in time series data.
Interpret Autocorrelation and Partial Autocorrelation plots (ACF/PACF) not just for modeling, but to identify temporal dependencies suggesting possible causal pathways.
Communicate insights from time series data clearly and explainably to support data-driven decisions.
Work with real datasets from the Federal Reserve (FRED), PJM energy markets, and financial data to master essential skills: joining temporal datasets with different frequencies, aggregating data across time periods with groupby, creating pivot tables for comparisons, and resampling to match analysis needs.
Learn regression analysis for time series: fit OLS models, calculate R-squared from scratch to understand model quality, diagnose autocorrelation with Durbin-Watson tests, and apply HAC standard errors to correct inflated significance. Discover how temporal discretization and regime-specific modeling dramatically improve explanatory power when economic relationships change across periods.
Every technique is taught through hands-on examples with energy generation, economic indicators, and stock data—giving you immediately applicable skills for your temporal datasets.
Learning objectives
Preprocess time series data and create visualizations to highlight patterns and anomalies across time dimensions like minute, hour, weekday, and month.
Analyze and decompose time series into trend, seasonal, and irregular components to isolate and explain underlying drivers.
Use differencing and other techniques to reveal hidden relationships and reduce confounding factors in causal analysis.
Apply statistical models, including regression and correlation analysis, to quantify relationships and test causal hypotheses in time series data.
Interpret Autocorrelation and Partial Autocorrelation plots (ACF/PACF) not just for modeling, but to identify temporal dependencies suggesting possible causal pathways.
Communicate insights from time series data clearly and explainably to support data-driven decisions.
Concepts
Introduction
- Why take Practical Python for Time-Series Analysis
- Dev environment
- Tracking your progress
Join and Preprocess Time Series Data
- Combine multiple time series datasets
- Download and load FRED data
- Concatenate time series with pandas.concat()
- Inner join vs. outer join
- Fill missing data with linear interpolation
- Automate loading with for loops
- Rename columns and export data
Groupby for Time Series Bar Charts
- Aggregate time series data
- Extract temporal properties from datetime index
- Create stacked bar charts with Plotly
- Create faceted charts with Plotly
Assignment - Practice DataFrame.groupby on New Data
- Download energy data from EIA API
- Download Federal Reserve data via FRED API
Pivot Table for Time Series Heat Matrix
- Create heat map visualizations
- Create a heat matrix with pivot tables
- Sort a heat matrix to create a ranking
- Heat matrix and box plot - When to use which
- How to manipulate pivot tables for interactive charts
Temporal Resampling for Automated Aggregations
- Aggregate historical time series data
- Aggregate time series by year with resample
- Interactive Plotly heat matrix
Simple Linear Regression
- Linear regression fundamentals
- Implement linear regression with statsmodels
- Interpret linear regression coefficients
- Regression diagnostics and assumptions
- Robust regression
- Robust regression for assumption violations
Assignment - Practice Simple Linear Regression on New Data
- How to download new data and adapt notebooks to replicate steps
Regression with Categorical Variables
- Incorporate categorical variables into regression models
- Visualize categorical regression with faceted charts
- Run regression with categorical predictors
- Compute categorical regression with statsmodels
Feature Engineering for Time Series
- Feature engineering fundamentals
- Filter data and discretize temporal period
- Reduce granularity with resample
- Transform features with rolling windows
- Compare feature transformation performance
Assignment - Complete Time Series Regression Workflow
- How to download new data and adapt notebooks to replicate steps