7.2 Missing and irregular timestamps in cuDF
interpolate() and resample().
Key points
Interpolation estimates missing values from their neighbors. Linear interpolation assumes a straight line between the known points. With irregular timestamps, method='index' uses the time index as the x-axis. NaN means not a number.
What NVIDIA says (3)
“Parameters : method str, default ‘linear’ Interpolation technique to use.”
“Returns the same object type as the caller, interpolated at some or all NaN values”
“‘index’, ‘values’: linearly interpolate using the index as an x-axis.”
Resampling regroups time series data onto a new, fixed time grid. You then aggregate (or interpolate) within each bin.
What NVIDIA says (2)
“Parameters : rule: str The offset string representing the frequency to use.”
“First, we create a time series with 1 minute intervals”
Key terms
- Interpolation: Estimating a missing value from the known values around it.
- Resampling: Converting a time series to a new regular frequency, such as one value per minute.
Try it
Sample question
A sensor series in cuDF has gaps (NaN values). Which method fills them by drawing straight lines between known points?
Show the answer
Answer: DataFrame.interpolate() with method='linear'
Interpolation estimates missing values from their neighbors. Linear interpolation assumes a straight line between the known points. With irregular timestamps, method='index' uses the time index as the x-axis. NaN means not a number.
What NVIDIA says (3)
“Parameters : method str, default ‘linear’ Interpolation technique to use.”
“Returns the same object type as the caller, interpolated at some or all NaN values”
“‘index’, ‘values’: linearly interpolate using the index as an x-axis.”
Practice 7.2 (2 questions) Full Advance Data Structures guide
← 7.1 Time series splits and forecast evaluation · 7.3 CPU versus GPU for temporal analytics →