This is testing NumPy arrays, reshaping, and transpose. Let’s go step by step.
Code:
Step 1: np.arange(6)
-
Generates numbers from 0 to 5.
Step 2: .reshape(2,3)
-
Reshapes into a 2 rows × 3 columns array.
So shape = (2, 3).
Step 3: a.T (transpose)
-
Transpose swaps rows and columns.
Now it has 3 rows × 2 columns.
Step 4: .shape
-
The new shape is (3, 2).
✅ Final Output:
(3, 2)


0 Comments:
Post a Comment