Bird
0
0

Why does numpy.transpose() reverse the axes order by default when no axes are specified?

hard📝 Conceptual Q10 of 15
NumPy - Array Manipulation
Why does numpy.transpose() reverse the axes order by default when no axes are specified?
ABecause it flattens the array and reshapes it automatically.
BBecause it sorts the axes in descending order for performance reasons.
CBecause it swaps only the first two axes by default.
DBecause reversing axes order is the standard mathematical definition of transpose for multi-dimensional arrays.
Step-by-Step Solution
Solution:
  1. Step 1: Understand transpose definition

    Transpose generalizes matrix transpose by reversing axes order in multi-dimensional arrays.
  2. Step 2: Confirm default behavior

    Default behavior reverses axes to match mathematical transpose concept.
  3. Final Answer:

    Because reversing axes order is the standard mathematical definition of transpose for multi-dimensional arrays. -> Option D
  4. Quick Check:

    Default transpose reverses axes order by math definition [OK]
Quick Trick: Default transpose reverses axes order by math rule [OK]
Common Mistakes:
  • Thinking it sorts axes
  • Assuming only first two axes swap
  • Believing it flattens array

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NumPy Quizzes