Recall & Review
beginner
What is the relationship between Pandas and NumPy?
Pandas is built on top of NumPy. It uses NumPy arrays to store data internally, which allows fast numerical operations and efficient memory use.
Click to reveal answer
beginner
How can you convert a Pandas DataFrame column to a NumPy array?
You can use the
.to_numpy() method on a DataFrame column to get a NumPy array of its values.Click to reveal answer
intermediate
Why is NumPy important for Pandas performance?
NumPy provides fast, vectorized operations on arrays. Pandas uses these to perform calculations quickly on large datasets without slow Python loops.
Click to reveal answer
intermediate
How do Pandas and NumPy handle missing data differently?
NumPy uses
np.nan to represent missing values in float arrays. Pandas extends this by supporting NaN in numeric columns and None or pd.NA in other types.Click to reveal answer
beginner
Show a simple example of creating a Pandas Series from a NumPy array.
Example:<br><pre>import numpy as np
import pandas as pd
arr = np.array([10, 20, 30])
series = pd.Series(arr)
print(series)</pre>Click to reveal answer
Which method converts a Pandas DataFrame column to a NumPy array?
✗ Incorrect
The correct method is
.to_numpy() which returns the column as a NumPy array.What does Pandas use internally to store data?
✗ Incorrect
Pandas stores data internally as NumPy arrays for efficient computation.
Which of these is a missing value marker in NumPy arrays?
✗ Incorrect
NumPy uses
np.nan (Not a Number) to represent missing values in float arrays.Why does Pandas rely on NumPy for performance?
✗ Incorrect
NumPy provides vectorized operations that allow fast calculations without slow Python loops.
Which of these is NOT a way Pandas handles missing data?
✗ Incorrect
Zero (0) is a valid number, not a missing data marker.
Explain how Pandas and NumPy work together to handle data efficiently.
Think about how Pandas builds on NumPy's strengths.
You got /4 concepts.
Describe how to convert data between Pandas and NumPy formats and why you might do this.
Consider when you want to use NumPy functions on Pandas data.
You got /4 concepts.