Sensor readings arrive every minute but some minutes are missing. Which step prepares a regular series in cuDF?
- Exam domain
- Advanced Data Structures7% of the exam
- Difficulty
- Medium
- In this mock
- 4 questions on this domainPractise this domain
Why the exam asks this
Advanced Data Structures (7% of the exam)
Objective in the exam guide: Managing missing or irregular timestamps with cuDF interpolation
cuDF interpolation for irregular timestamps is named.
Why B is the answer
Resample to a fixed frequency and interpolate the gaps
Resampling to a regular frequency exposes the gaps, and interpolation estimates missing values from neighbours.
Remember: Resample, then interpolate gaps.
How it works
Irregular timestamps are regularized and interpolated before analysis.
In detail
- Regularize the index.
- Interpolate small gaps.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Convert timestamps to stringsWrong
Strings break time operations.
B. Resample to a fixed frequency and interpolate the gapsRight
Resample, then interpolate gaps.
C. Delete every hour that has a gapWrongMost tempting
Deleting hours loses data.
Why it tempts: Dropping gaps keeps data clean.
D. Sort by sensor name onlyWrong
Sorting by name does not fill gaps.
Use case
An illustrative scenario, not a real incident.
Illustrative: linear interpolation fills 0.5% of missing minutes before forecasting.
See it in different ways
stateDiagram-v2 state "Irregular" as s0 state "Regular with gaps" as s1 state "Complete" as s2 [*] --> s0 s0 --> s1: resample s1 --> s2: interpolate s2 --> [*]
How to read this chart
- It starts at "Irregular".
- From "Irregular", "resample" moves it to "Regular with gaps".
- From "Regular with gaps", "interpolate" moves it to "Complete".
- It ends at "Complete".
flowchart TD
Q{"Gap length?"}
Q -->|"Short"| A0["Interpolate"]
Q -->|"Long"| A1["Flag or drop the period"]How to read this chart
- At "Gap length?": if "Short", go to "Interpolate"; if "Long", go to "Flag or drop the period".