TechNuggets Academy

Data Preparation and Manipulation with cuDF

Free NVIDIA-Certified Professional: Accelerated Data Science practice — 6 questions on Data Preparation and Manipulation with cuDF, with explanations. No sign-up. Full 12-question mixed test →

Question 1 of 6 · Data Preparation and Manipulation with cuDF
You have enabled GPU acceleration with `%load_ext cudf.pandas` in a Jupyter notebook. All prior cell operations ran on a DataFrame `df` created after the extension loaded. You then call `df.style.background_gradient()`, an accessor cuDF does not implement natively. What actually happens?
cudf.pandas wraps every pandas object in a proxy; when an operation isn't implemented in libcudf/cuDF, the proxy automatically falls back to the real CPU pandas execution path, moving the underlying data as needed, transparently to the user.
Question 2 of 6 · Data Preparation and Manipulation with cuDF
You run `cudf.Series([1, 2, None, 4])`. What is the resulting dtype, and how does this differ from pandas' default behavior for the same input list?
cuDF stores nullability via an Arrow-style validity bitmask independent of the value buffer, so integer columns keep their int64 dtype even with missing values. Pandas, without opting into nullable extension dtypes, upcasts int64 to float64 and uses NaN as the sentinel for missing data.
Question 3 of 6 · Data Preparation and Manipulation with cuDF
You need to split a cuDF string column on a comma where the number of resulting substrings varies per row, and you only need the first two resulting tokens as separate columns. Which approach is correct and GPU-efficient?
cuDF's str.split supports the `n` and `expand` parameters exactly like pandas, performing the ragged split entirely on GPU via libcudf strings kernels and padding shorter rows with nulls in the extra columns — no host round-trip required.
Question 4 of 6 · Data Preparation and Manipulation with cuDF
A cuDF DataFrame has a column 'transaction_id' containing 50 million unique string values and a column 'country' containing only 15 unique string values repeated across all 50 million rows. Before a large groupby, which single dtype change correctly targets GPU memory reduction?
Category dtype benefits low-cardinality columns because it stores a small dictionary of unique values plus compact integer codes. With only 15 distinct 'country' values across 50M rows, this drastically cuts memory versus storing repeated strings; groupby on the coded column is also faster.
Question 5 of 6 · Data Preparation and Manipulation with cuDF
Without using cudf.pandas, you call `.dt.to_period('M')` on a cuDF datetime64 column to bucket records into calendar months. What is the actual outcome?
cuDF does not implement several pandas extension dtypes, including Period (and Interval, Sparse). Calling .dt.to_period() on a native cuDF Series raises a NotImplementedError; the standard GPU-friendly workaround is to bucket via .dt.year/.dt.month or by flooring the timestamp to the month, then group on those integer/timestamp columns.
Question 6 of 6 · Data Preparation and Manipulation with cuDF
Which RAPIDS utility generates a synthetic, GPU-resident time-indexed cuDF DataFrame (with configurable id, x, and y columns) that is commonly used to benchmark cuDF groupby and join performance without loading external datasets?
cudf.datasets.timeseries() (mirroring dask's timeseries generator) produces a synthetic time-indexed DataFrame directly on the GPU with configurable frequency and id/x/y columns, making it a standard tool for benchmarking cuDF groupby/join/rolling operations without any I/O overhead.
Ready for the real thing?

The full course: two full-length practice tests, video lessons for every exam domain, hands-on labs and detailed explanations.

$129.99 $34.99 with code FREETEST33 — valid through September 9.

Get my $34.99 deal →