Learn what happens under the hood of statsmodel’s seasonal_decompose — If you have worked with time series, you have probably already used seasonal_decompose from statsmodel (or R’s equivalent). Long story short, it splits a time series into three components: trend, seasonality, and the residuals. After running the command, you see something like the plot below.