Managing missing or irregular timestamps with cuDF: Practice Questions — Advanced Data Structures (NVIDIA-Certified Associate: Accelerated Data Science)
Practice Questions: Managing Missing or Irregular Timestamps with cuDF This set of multiple-choice questions is designed to help candidates prepare...
Practice Questions: Managing Missing or Irregular Timestamps with cuDF
This set of multiple-choice questions is designed to help candidates prepare for the NVIDIA-Certified Associate: Accelerated Data Science exam, focusing on handling missing or irregular timestamps using cuDF. Each question includes four options, the correct answer, and a brief explanation.
Which cuDF function is most appropriate for identifying missing timestamps in a time-series column?
- A. cudf.to_datetime()
- B. cudf.Series.isnull()
- C. cudf.Series.drop_duplicates()
- D. cudf.Series.fillna()
Correct Answer: B
Explanation: cudf.Series.isnull() detects missing (null) values in a column, which is essential for identifying missing timestamps.
How can you handle irregular timestamps in a cuDF DataFrame to create a regular time index for resampling?
- A. Use cudf.Series.interpolate() to fill missing timestamps
- B. Use cudf.date_range() to generate a regular timestamp index and then merge
- C. Use cudf.Series.dropna() to remove irregular timestamps
- D. Use cudf.Series.unique() to filter timestamps
Correct Answer: B
Explanation: Generating a regular timestamp index with cudf.date_range() and merging it with the original data allows for consistent resampling and handling of irregular timestamps.
Which method is best for filling missing timestamps with forward-fill in cuDF?
- A. cudf.Series.fillna(method='ffill')
- B. cudf.Series.fillna(method='bfill')
- C. cudf.Series.interpolate()
- D. cudf.Series.dropna()
Correct Answer: A
Explanation: Forward-fill (ffill) propagates the last valid observation forward to fill missing timestamps, which is useful for time-series continuity.
When working with time-series data in cuDF, what is the recommended approach to detect irregular intervals between timestamps?
- A. Calculate the difference between consecutive timestamps using cudf.Series.diff()
- B. Use cudf.Series.isnull() on the timestamp column
- C. Apply cudf.Series.unique() on the timestamp column
- D. Use cudf.Series.drop_duplicates() on the timestamp column
Correct Answer: A
Explanation: cudf.Series.diff() computes the difference between consecutive timestamps, helping to identify irregular intervals.
Which cuDF operation helps to resample a time-series DataFrame with missing timestamps after creating a regular timestamp index?
- A. cudf.DataFrame.merge()
- B. cudf.DataFrame.groupby()
- C. cudf.DataFrame.asfreq()
- D. cudf.DataFrame.resample()
Correct Answer: D
Explanation: cudf.DataFrame.resample() allows resampling of time-series data to a specified frequency, filling in missing timestamps as needed.
How can you handle missing timestamps that are irregularly spaced in cuDF before forecasting?
- A. Remove all rows with missing timestamps
- B. Fill missing timestamps using interpolation or forward-fill methods
- C. Ignore missing timestamps and proceed with modeling
- D. Convert timestamps to strings
Correct Answer: B
Explanation: Filling missing timestamps with interpolation or forward-fill maintains data continuity, which is critical for accurate forecasting.
What is the effect of using cudf.Series.asfreq() on a time-series with missing timestamps?
- A. It drops all missing timestamps
- B. It converts the series to a specified frequency, inserting missing timestamps with NaN values
- C. It sorts the timestamps in descending order
- D. It fills missing timestamps with zeros
Correct Answer: B
Explanation: asfreq() changes the frequency of the time-series, inserting missing timestamps and marking their values as NaN for further handling.
Which cuDF method allows you to convert a column with string timestamps to a datetime format suitable for time-series analysis?
- A. cudf.to_datetime()
- B. cudf.Series.astype('int')
- C. cudf.Series.str.split()
- D. cudf.Series.isnull()
Correct Answer: A
Explanation: cudf.to_datetime() converts string timestamps to datetime objects, enabling time-series operations and handling of missing or irregular timestamps.
More in this topic
Ready to test your knowledge?
Put what you've learned into practice with a quick quiz and track your progress.
Test your knowledge →