NCA-ADS - Foundations of Accelerated Data Science (12% of the exam) - Section 5.1

Apply Python fundamentals with NumPy, pandas, and Jupyter.

Apply core Python data science tools - NumPy for array operations, pandas for tabular data, and Jupyter for interactive notebooks - as the foundation of accelerated workflows. Recognise how these libraries integrate with RAPIDS and form the base layer that cuDF and cuML replace or extend.

NumPypandasJupyter

Practice question for this objective

Free sampleFoundations of Accelerated Data Scienceeasy

A data scientist rewrites a loop that iterates over one million floating-point values in a Python list, replacing it with a NumPy array operation. Which outcome best explains the speedup?

  • ANumPy automatically distributes the loop across all available CPU cores using the threading module, which reduces wall-clock time proportionally to the core count.
  • BNumPy converts each Python integer or float to a C double before the loop begins, which reduces the cost of each individual Python type-check inside the loop body.
  • CNumPy caches the result of the first iteration and reuses it for subsequent identical values, reducing the effective number of arithmetic operations the CPU must perform.
  • DNumPy stores data in contiguous memory blocks of a single type, allowing low-level vectorised CPU instructions to process many elements at once without Python interpreter overhead per element. Correct
Explain why NumPy vectorised array operations outperform equivalent Python loops for large numeric datasets. A pure Python loop pays a Python interpreter dispatch cost for each element: boxing the value as a Python object, evaluating the loop condition, and calling the operation. NumPy arrays store elements as raw C-level numeric types in a contiguous memory block, enabling the CPU to apply SIMD vectorised instructions across many elements in a single instruction cycle with no per-element interpreter overhead. This architectural difference, rather than multithreading or caching, is the primary reason vectorised NumPy operations are orders of magnitude faster than equivalent Python loops on large arrays.

Why A is wrong: NumPy's standard array operations are single-threaded by default; the speedup comes from vectorised instructions and C-level execution, not automatic multithreading via the threading module.

Why B is wrong: While NumPy does use C-level numeric types, the benefit is eliminating the loop overhead entirely through vectorised operations, not merely reducing per-iteration type-check cost inside a continued Python loop.

Why C is wrong: NumPy does not apply memoisation or result caching across array elements; every element is processed. The performance gain is from vectorised execution, not skipping repeated computations.

Why D is correct: NumPy's homogeneous, contiguous arrays let SIMD/vectorised CPU instructions operate on batches of elements, bypassing the per-element Python object overhead that makes pure Python loops slow.

See more NCA-ADS practice questions, answers explained.

Exam traps in Foundations of Accelerated Data Science

Answers that look right on this material and are not. Each one is a distractor from a different question in the NCA-ADS bank for this domain.

  • Call the to_pandas conversion on the cuDF DataFrame and feed the resulting pandas object to XGBoost so both libraries agree on a common in-memory layout.

    Why it is wrong: Converting to pandas is tempting because pandas is the conventional XGBoost input, but the to_pandas conversion copies every column from device to host memory, which is precisely the host round-trip the team wants to avoid.

  • XGBoost is a submodule inside cuML, so its gradient-boosting estimator is imported from the cuML package alongside the other cuML models.

    Why it is wrong: It is tempting to assume every RAPIDS-compatible model lives in cuML, but XGBoost is maintained as its own project and is not a cuML submodule; cuML offers other estimators while GPU boosting comes from the standalone XGBoost library.

  • The GPU lacks an instruction for group-by aggregation, so cuDF emulates it slowly in software while pandas uses a native CPU instruction; the GPU only wins on workloads with such a hardware instruction.

    Why it is wrong: There is no single CPU instruction for group-by either, and cuDF implements aggregation with real GPU kernels rather than slow emulation, so this invents a hardware distinction; the genuine issue is fixed GPU overheads being large relative to a tiny dataset.

More in this domain

Back to all Foundations of Accelerated Data Science objectives, or the NCA-ADS cert hub.

Examworthy is not affiliated with or endorsed by NVIDIA. Original, blueprint-aligned practice material only.