From the course: Practical Python for Time Series Analysis

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Aggregate time series by year with resample

Aggregate time series by year with resample - Python Tutorial

From the course: Practical Python for Time Series Analysis

Aggregate time series by year with resample

- [Instructor] This heat matrix represents the average of each one of the indicators throughout the years. This time, we are working with the Resample function, which is another one of the aggregation functions that we've got inside pandas, and I'll show you very simple how to work with them as well as the rules that we have to aggregate by quarter information, year information, or any other frequency rule. First, we load the data that contains the monthly information of these indicators, as we can see in the plot. However, we'd like to have a yearly information that we can visualize through line charts or the heat matrix we've got below. To do so, it's very simple using the Resample function where we can pass from having the 4,000 rows to have with the resample for each one of the rules that we put. In this case, we can specify rule equals to each one of the years, and then aggregate the information so that all…

Contents