From the course: Practical Python for Time Series Analysis

Aggregate time series data

- [Instructor] Groupby for Bar Charts. In this notebook, you will learn the steps to develop visualizations like this, where we have the energy generation in California for each one of the months and the technologies. We kind of serve that during the summer months. We've got more solar generation while during the rest of the months, we've got lower generation in solar energy, among other technologies that can be interpreted in the same way. By learning the techniques of this chapter, you will learn how to develop visualizations like this one on any timeseries data set. First, we will start by loading the raw dataset, which contains the hourly generation for each one of the technologies. Calculate the temporal properties so that we can aggregate by the month, the hours, and the rest of temporal properties. Then we'll jump onto the steps. First, aggregating the data using the groupby function from Pandas, resetting the index so that we have a data frame, and finally, composing the visualization of the bar chart. But this time, it's only energy generation by technology and hour. Then I introduce you to the different parameters, which if you aggregate by three categorical columns, you'll be able to plot with facets, which is different plots for the unique categories of a categorical column. And the same way, you can apply facets with plots, you'll be able to apply the facets by the rows or even by rows and columns at the same time. In this case, columns the weekdays, and in the rows, we've got the months. Now, time to learn the codes to develop this nice visualization that will serve you to analyze the raw information with thousands of rows better and smoothly.

Contents