Practice Shape and Reshape - 3.6 | Chapter 3: Understanding NumPy for Machine Learning | Machine Learning Basics
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Shape and Reshape

3.6 - Shape and Reshape

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Learning

Practice Questions

Test your understanding with targeted questions

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?

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

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.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

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?

Challenge 2 Hard

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?

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.