From the course: Python in Excel: Data Outputs in Custom Data Visualizations and Algorithms

Unlock the full course today

Join today to access over 24,800 courses taught by industry experts.

Breaking down time series models into components

Breaking down time series models into components

- [Instructor] We can analyze Time Series Models by time Units, like year, month, day, or hour. We can also break them down into separate components for trends, seasonality, and anomalies and outliers. Python has libraries like stats models that enables to break down the components of time series models through functions like seasonal_decompose. Let's import this library, as well as Matplotlib into our model, in addition to the Pandas and NumPy libraries we're already using. I already ran all the steps in the ETL framework section to create a daily data frame object DF, and a monthly data frame object called monthly that we can use in our time series models. Let's then reference the average temperature series from the data frame in our seasonal decompose function. We'll create a new variable called series and set it equal to the average temperature from the data frame object DF. We'll also show only the most recent 1000 rows of data by chaining tail to the end of our series. We'll…

Contents