Data integration and manipulation with cuDF and pandas: Practice Questions — Data Manipulation and Preparation (NVIDIA-Certified Associate: Accelerated Data Science)
Practice Questions: Data Integration and Manipulation with cuDF and pandas This set of multiple-choice questions is designed to help candidates...
Practice Questions: Data Integration and Manipulation with cuDF and pandas
This set of multiple-choice questions is designed to help candidates prepare for the NVIDIA-Certified Associate: Accelerated Data Science exam, focusing specifically on data integration and manipulation using cuDF and pandas. Each question includes four options, the correct answer, and a brief explanation.
Which of the following best describes a key advantage of using cuDF over pandas?
- A) cuDF supports distributed computing natively, while pandas does not.
- B) cuDF leverages GPU acceleration for faster DataFrame operations.
- C) cuDF has more extensive data visualization capabilities than pandas.
- D) cuDF automatically handles missing data better than pandas.
Correct Answer: B
Explanation: cuDF is designed to run DataFrame operations on NVIDIA GPUs, providing significant speedups compared to pandas, which runs on CPUs.
When converting a pandas DataFrame to a cuDF DataFrame, which method is commonly used?
- A) cudf.DataFrame.from_pandas()
- B) pandas.DataFrame.to_cudf()
- C) cudf.convert_from_pandas()
- D) pandas.DataFrame.convert_gpu()
Correct Answer: A
Explanation: The cudf.DataFrame.from_pandas() method converts a pandas DataFrame into a cuDF DataFrame for GPU-accelerated processing.
Which cuDF function is typically used to handle missing values in a DataFrame?
- A) fillna()
- B) dropna_gpu()
- C) replace_nulls()
- D) nan_handler()
Correct Answer: A
Explanation: The fillna() function in cuDF fills missing values similarly to pandas, enabling data cleaning on GPU.
What is the primary difference between pandas and cuDF when performing groupby operations?
- A) cuDF groupby operations are slower due to GPU overhead.
- B) cuDF groupby operations require explicit memory management.
- C) cuDF groupby operations are GPU-accelerated, often faster than pandas.
- D) cuDF does not support groupby operations.
Correct Answer: C
Explanation: cuDF supports groupby operations accelerated on the GPU, leading to faster execution compared to pandas on CPU.
Which of the following is a correct way to concatenate two cuDF DataFrames vertically?
- A) cudf.concat([df1, df2], axis=1)
- B) cudf.concat([df1, df2], axis=0)
- C) df1.append(df2, axis=1)
- D) df1.merge(df2)
Correct Answer: B
Explanation: Using cudf.concat() with axis=0 concatenates DataFrames vertically (row-wise).
In cuDF, which method would you use to convert a categorical column to numerical codes?
- A) to_numeric()
- B) cat.codes
- C) encode()
- D) convert_categories()
Correct Answer: B
Explanation: The cat.codes attribute converts categorical data into numerical codes, similar to pandas.
Which of the following statements about interoperability between pandas and cuDF is TRUE?
- A) DataFrames can be converted back and forth between pandas and cuDF with minimal overhead.
- B) cuDF DataFrames cannot be converted to pandas DataFrames.
- C) pandas DataFrames can be directly processed on GPU without conversion.
- D) cuDF automatically syncs changes with pandas DataFrames in real time.
Correct Answer: A
Explanation: cuDF provides methods to convert DataFrames to and from pandas, enabling flexible workflows between CPU and GPU processing.
Which of the following is NOT a typical use case for cuDF in data manipulation?
- A) Accelerated filtering and selection of rows.
- B) GPU-accelerated joins and merges.
- C) Real-time streaming data ingestion.
- D) Handling large datasets that exceed CPU memory limits.
Correct Answer: C
Explanation: While cuDF accelerates many batch data manipulation tasks, real-time streaming ingestion is generally handled by other frameworks like RAPIDS or Dask, not cuDF alone.
More in this topic
Preparing for the NCA-ADS exam?
Start free with 5 practice quizzes a day and track your progress.
Practise NCA-ADS questions free →