5.1 Python for data analysis

NCA-ADS · Foundations of Accelerated Data Science (12% of the exam) · Official objective: “Python fundamentals for data analysis (NumPy, pandas, Jupyter)”

NumPy arrays, pandas DataFrames and Jupyter with cudf.pandas.

Key points

  1. An array is a grid of values of one type. NumPy is the base that pandas and scikit-learn build on. SQL means Structured Query Language.

    What NVIDIA says (2)

    “What is NumPy NumPy is a powerful, well-optimized, free open-source library for the Python programming language, adding support for large, multi-dimensional arrays (also called matrices or tensors).”

    — NVIDIA Glossary: NumPy

    “As the core library for scientific computing, NumPy is the base for libraries such as Pandas, Scikit-learn , and SciPy .”

    — NVIDIA Glossary: NumPy

  2. The DataFrame is pandas' core data structure. Columns can hold numbers, categories or text. CSV means comma-separated values.

    What NVIDIA says (1)

    “A pandas DataFrame is a two-dimensional, array-like table where each column represents values of a specific variable, and each row contains a set of values corresponding to those variables.”

    — What Is Pandas and Why Does it Matter?

  3. Jupyter is an interactive notebook for code, results and notes. Magic commands like %load_ext change how the notebook runs code.

    What NVIDIA says (1)

    “Just %load_ext cudf.pandas in Jupyter, or pass -m cudf.pandas on the command line.”

    — cuDF: cudf.pandas

Key terms

Sample question

What does NumPy add to Python for data analysis?

Show the answer

Answer: Fast multi-dimensional arrays and math functions that work on whole arrays

An array is a grid of values of one type. NumPy is the base that pandas and scikit-learn build on. SQL means Structured Query Language.

What NVIDIA says (2)

“What is NumPy NumPy is a powerful, well-optimized, free open-source library for the Python programming language, adding support for large, multi-dimensional arrays (also called matrices or tensors).”

— NVIDIA Glossary: NumPy

“As the core library for scientific computing, NumPy is the base for libraries such as Pandas, Scikit-learn , and SciPy .”

— NVIDIA Glossary: NumPy

Practice 5.1 (3 questions) Full Foundations of Accelerated Data Science guide

← 4.5 Patterns, trends and relationships · 5.2 Why GPUs speed up data science →