Practice NumPy (Numerical Python) - 4.1 | Python for Data Science | Data Science Basic
K12 Students

Academics

AI-Powered learning for Grades 8–12, aligned with major Indian and international curricula.

Academics
Professionals

Professional Courses

Industry-relevant training in Business, Technology, and Design to help professionals and graduates upskill for real-world careers.

Professional Courses
Games

Interactive Games

Fun, engaging games to boost memory, math fluency, typing speed, and English skillsβ€”perfect for learners of all ages.

games

Practice Questions

Test your understanding with targeted questions related to the topic.

Question 1

Easy

Create a 1D NumPy array containing numbers 1 to 5.

πŸ’‘ Hint: Use `np.array` to create an array.

Question 2

Easy

What is the output of np.array([1, 2, 3]).mean()?

πŸ’‘ Hint: Consider what the mean of {1, 2, 3} is.

Practice 4 more questions and get performance evaluation

Interactive Quizzes

Engage in quick quizzes to reinforce what you've learned and check your comprehension.

Question 1

What does the command np.array([5, 10, 15]) do?

  • Creates a list with values 5
  • 10
  • and 15
  • Creates a NumPy array with values 5
  • 10
  • and 15
  • Creates a dictionary with values 5
  • 10
  • and 15

πŸ’‘ Hint: Consider what the prefix 'np' indicates.

Question 2

True or False: An ndarray can contain elements of different data types.

  • True
  • False

πŸ’‘ Hint: Think about the structure of data in NumPy.

Solve 2 more questions and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

Given two NumPy arrays, a = np.array([1, 2, 3]) and b = np.array([4, 5, 6]), write a function that returns their element-wise product.

πŸ’‘ Hint: Think of how NumPy allows operations on arrays directly.

Question 2

Create a 2D NumPy array representing a dataset of 3 different plants with 4 features each, and compute the standard deviation of each feature.

πŸ’‘ Hint: Take advantage of NumPy’s abilities to handle multidimensional data.

Challenge and get performance evaluation