From the course: Data Science Foundations: Data Mining in Python

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Time-Series decomposition

Time-Series decomposition - Python Tutorial

From the course: Data Science Foundations: Data Mining in Python

Start my 1-month free trial

Time-Series decomposition

- [Instructor] One of the best ways to start working with time-series data is not to start modeling it immediately but to start describing it and doing a very simple kind of analysis. Remember, analysis means to break things into their constituent components. And what we're going to do is called time-series decomposition, where you are taking it apart. You are decomposing it into its elements. One of the great things about decomposition is that it's visual. And so let's start by importing a few libraries including statsmodels, which will give us the seasonal decompose function. And then we'll import our data set with AirPassengers.csv saved locally in our data folder and we'll plot the data as it is. And so what you see here again is the strong, upward trend in the number of air passengers year to year, but also a strong seasonal trend where it's higher in the summer and lower in the winter. What we want to do now is…

Contents