Is there any other function in NumPy to transpose a 2D array?

I have been exploring the NumPy library and came across this function on how to transpose an array (or a matrice) using NumPy:

I wanted to know if there are any other methods in the NumPy library that I’ve missed out on, can someone drop-in alternative methods to it?

1 Like

Hello @safiaa.02, an alternative method for your task would be using the T attribute provided by NumPy to transpose any 2D array. It is quite simple to use and it is also efficient, here is an example code which uses this attribute: