January 2020
Beginner to intermediate
372 pages
10h
English
In this recipe, we created new features that aggregate energy consumption with commonly used mathematical computations, which are built into pandas. We can also apply user-defined computations. In this section, we will create two functions to detect the number of local maxima and minima in time series, and then calculate those values per day of energy consumption.
To do this, we'll import pandas, load the data, and parse the date variable into datetime format, just like we did in step 1 to step 3 of this recipe:
from scipy.signal import find_peaks
Read now
Unlock full access