0
0
NumPydata~5 mins

Matrix transpose operations in NumPy - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the transpose of a matrix do?
It flips the matrix over its diagonal, switching the row and column indices of each element.
Click to reveal answer
beginner
How do you transpose a matrix using NumPy?
Use the .T attribute on a NumPy array, like matrix.T.
Click to reveal answer
beginner
What is the shape of the transpose of a matrix with shape (3, 5)?
The transpose will have shape (5, 3), swapping rows and columns.
Click to reveal answer
beginner
True or False: Transposing a matrix twice returns the original matrix.
True. Transposing twice flips the matrix back to its original form.
Click to reveal answer
intermediate
How can you transpose a 3D NumPy array along specific axes?
Use np.transpose(array, axes=(...)) to reorder axes as needed.
Click to reveal answer
What does matrix.T do in NumPy?
AReturns the matrix multiplied by 2
BReturns the inverse of the matrix
CReturns the determinant of the matrix
DReturns the transpose of the matrix
If a matrix has shape (4, 7), what is the shape of its transpose?
A(7, 4)
B(4, 7)
C(1, 28)
D(28, 1)
Which NumPy function allows transposing with custom axis order?
Anp.transpose()
Bnp.reshape()
Cnp.flatten()
Dnp.dot()
What happens if you transpose a matrix twice?
AYou get the inverse matrix
BYou get a zero matrix
CYou get the original matrix
DYou get a matrix with doubled values
Which of these is NOT true about matrix transpose?
AIt swaps rows and columns
BIt multiplies each element by -1
CIt flips the matrix over its diagonal
DIt changes the shape of the matrix
Explain how to transpose a 2D matrix in NumPy and describe what happens to its shape.
Think about flipping the matrix over its diagonal.
You got /3 concepts.
    Describe how to transpose a 3D NumPy array along specific axes and why this might be useful.
    Consider how axes represent dimensions in arrays.
    You got /3 concepts.