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.

Solution: Comparing time series components to anomalies

Solution: Comparing time series components to anomalies

(upbeat music) - [Instructor] So how did it go? Let's explore how to create this output in code spaces first before translating it into Python and Excel code. Let's first import the parts of the statsmodel library, as well as the matplotlib library into our model that we want to use in addition to the libraries we already imported into our solution. We already ran the steps to create the hourly data frame. Now let's create a result variable to store the output of the seasonal decompose function to reference the temperature field from this hourly data. We'll set the model parameter as additive and the period parameter to 24, because each day has a 24-hour cycle within it. We'll then follow the necessary steps we learned in this chapter to chain the plot function to the decompose result variable that's called result, and display the visual. Now in Excel, let's translate these steps. Let's first import the libraries that we used within the code spaces into our Excel file. Next, let's add…

Contents