5.1 Python for data analysis
NumPy arrays, pandas DataFrames and Jupyter with cudf.pandas.
Key points
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).”
“As the core library for scientific computing, NumPy is the base for libraries such as Pandas, Scikit-learn , and SciPy .”
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.”
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.”
Key terms
- NumPy: A Python library for fast multi-dimensional arrays and math on whole arrays.
- pandas: A Python library for working with tables of data, called DataFrames.
- DataFrame: A two-dimensional table where each column is one variable and each row is one record.
- Jupyter notebook: An interactive document that mixes code, output and notes, run cell by cell.
- cudf.pandas: A cuDF mode that runs existing pandas code on the GPU without code changes and falls back to the CPU when needed.
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).”
“As the core library for scientific computing, NumPy is the base for libraries such as Pandas, Scikit-learn , and SciPy .”
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 →