Skip to content

NumPy for Climate Scientists Interactive Quiz

Test your NumPy knowledge for climate data analysis with this interactive quiz! Select your answers and get instant scoring.


📋 Assessment Guidelines

📝 Interactive Format

Select answers by clicking radio buttons or checkboxes

✅ Instant Scoring

Submit to see your score and detailed feedback

🔄 Retake Anytime

Reset and try again to improve your score

Question 1: Array Dimensions

Which attribute returns the number of dimensions of a NumPy array?

Question 2: Array Shape

Given arr = np.array([[1, 2, 3], [4, 5, 6]]), what does arr.shape return?

Question 3: Creating Arrays - Multiple Select

Select ALL NumPy functions that create arrays:

Question 4: np.arange vs np.linspace

What is the main difference between np.arange() and np.linspace()?

Question 5: Array Creation

Which function creates an identity matrix (diagonal matrix with 1s)?

Question 6: Random Numbers

Which function generates random numbers from a uniform distribution between 0 and 1?

Question 7: Array Indexing

Given arr = np.array([10, 20, 30, 40, 50]), what does arr[1:4] return?

Question 8: Boolean Masking

What does boolean masking (fancy indexing) allow you to do?

Question 9: Broadcasting

What is broadcasting in NumPy?

Question 10: Vectorization Benefits - Multiple Select

Select ALL advantages of vectorization with NumPy:

Question 11: Reduction Operations - Multiple Select

Select ALL valid NumPy reduction functions:

Question 12: Axis Parameter

For a 2D array with shape (3, 4), what does arr.sum(axis=0) return?

Question 13: Weighted Averages

In climate data analysis, why do we use area weights when computing global averages?

Question 14: Linear Algebra

Which NumPy function computes matrix multiplication?

Question 15: Saving Arrays

Which function saves a NumPy array to a .npy file?

Question 16: Loading Arrays

Which function loads a NumPy array from a .npy file?

Question 17: DateTime Arrays

Which NumPy data type is used for working with dates and times?

Question 18: Array Reshaping

Given an array with 12 elements, which shape is NOT valid for reshaping?

Question 19: Element-wise Operations

What does the * operator do when applied to two NumPy arrays?

Question 20: True or False

NumPy arrays can contain elements of different data types (like Python lists).


💡 Tips for Success

  • Think about array shapes and dimensions carefully
  • Remember that NumPy uses 0-based indexing
  • Understand the difference between element-wise and matrix operations
  • For multiple select questions, select ALL correct answers
  • Pay attention to axis parameters in reduction operations
  • Consider when to use broadcasting vs explicit loops
  • Practice with small examples to verify your understanding!

📚 Additional Resources


🚀 Key Concepts Covered

This quiz tests your understanding of:

  1. Array Basics - ndim, shape, size, dtype
  2. Array Creation - array(), arange(), linspace(), zeros(), ones(), eye()
  3. Random Numbers - Uniform and Gaussian distributions
  4. Indexing & Slicing - Basic and advanced indexing
  5. Boolean Masking - Conditional selection
  6. Broadcasting - Automatic shape matching
  7. Vectorization - Fast operations without loops
  8. Reductions - mean(), sum(), std(), max(), min() with axis parameter
  9. Area Weighting - Climate data specific considerations
  10. Linear Algebra - Matrix operations, dot products
  11. I/O Operations - save(), load()
  12. DateTime - Working with temporal data
  13. Array Manipulation - Reshaping and element-wise operations

Good luck! NumPy is the foundation for all climate data analysis in Python! 🔢📊

In Partnership With