Bird
0
0

What does the reshape() function do in NumPy?

easy📝 Conceptual Q11 of 15
NumPy - Array Manipulation
What does the reshape() function do in NumPy?
ACreates a new array with random values
BChanges the shape of an array without changing its data
CSorts the elements of an array
DDeletes elements from an array
Step-by-Step Solution
Solution:
  1. Step 1: Understand the purpose of reshape()

    The reshape() function changes the shape (dimensions) of an existing array but keeps the data intact.
  2. Step 2: Compare with other options

    Options A, B, and C describe different functions or actions unrelated to reshaping.
  3. Final Answer:

    Changes the shape of an array without changing its data -> Option B
  4. Quick Check:

    reshape() = change shape only [OK]
Quick Trick: reshape() changes shape, data stays same [OK]
Common Mistakes:
  • Thinking reshape() changes data values
  • Confusing reshape() with sorting or deleting
  • Assuming reshape() creates new random arrays

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NumPy Quizzes