Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What does the shape attribute of a NumPy array indicate?
Think about structure!
How do you access the shape of a NumPy array named 'data'?
What do we add after the variable?
What does the .shape attribute return?
Consider what tells you the arrangement of data.
True or False: Reshaping an array changes the data within it.
Think about what reshape does.
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.
How many total elements do you have to work with?
Given a 3D array with shape (2, 3, 4), how would you reshape it to a 4D array? Discuss any challenges with dimension compatibility.
What do you need to remember about the number of elements when reshaping?
5 more questions in this section. Enroll free to practise them all.
Enroll free