Practice Shape and Reshape - 3.6 | Chapter 3: Understanding NumPy for Machine Learning | Machine Learning Basics
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

What does the shape attribute of a NumPy array indicate?

πŸ’‘ Hint: Think about structure!

Question 2

Easy

How do you access the shape of a NumPy array named 'data'?

πŸ’‘ Hint: What do we add after the variable?

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 .shape attribute return?

  • Dimensions of the array
  • Data in the array
  • Type of the array

πŸ’‘ Hint: Consider what tells you the arrangement of data.

Question 2

True or False: Reshaping an array changes the data within it.

  • True
  • False

πŸ’‘ Hint: Think about what reshape does.

Solve 1 more question and get performance evaluation

Challenge Problems

Push your limits with challenges.

Question 1

You have an array of shape (6,) containing numbers 1 to 6. How can you reshape it to a 2x3 array? Write the code and describe the output shape.

πŸ’‘ Hint: How many total elements do you have to work with?

Question 2

Given a 3D array with shape (2, 3, 4), how would you reshape it to a 4D array? Discuss any challenges with dimension compatibility.

πŸ’‘ Hint: What do you need to remember about the number of elements when reshaping?

Challenge and get performance evaluation