From the course: Python for Time Series Forecasting

Unlock this course with a free trial

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

Data preprocessing for insightful decomposition

Data preprocessing for insightful decomposition - Python Tutorial

From the course: Python for Time Series Forecasting

Data preprocessing for insightful decomposition

- [Instructor] We load the hourly data sets with all fuel types, but we want to get a data frame with 72 rows, with the monthly information of only one fuel type, which is solar energy. To reach such pre-processing, we must first work with the data frame, and detect which are the fuel types we are working with. So we access the column fuel type, and also the description name, and get the unique values so we can drop duplicates, and get which one corresponds to the solar energy, which is the sun. Therefore, in the data frame, to filter for the rows which are solar generation, we access the fuel type column, and ask for those which are equal to "sun". We get true or false, which means that this is a mask that can be used to access the information in the regional data frame, and only get the rows whose values are true. In other words, whose values are "sun". Once we execute, here we get the rows with only sun energy generation. In addition to this way of filtering the rows by a…

Contents