NumPy ndarray.T | Get View of Transposed Array Last Updated : 11 Jul, 2025 Comments Improve Suggest changes 2 Likes Like Report The NumPy ndarray.T attribute finds the view of the transposed Array. It can transpose any array having a dimension greater than or equal to 2. It works similarly to the numpy.transpose() method but it is easy and concise to use. SyntaxSyntax: ndarray.T Returns Transpose of given arrayExamplesLet's look at how to use the ndarray.T attribute of the Python's NumPy library. Example 1 Python3 import numpy as np arr = np.array([[1, 2, 3], [4, 5, 6]]) # applying ndarray.T object transposed_array = arr.T print(transposed_array) Output[[1 4] [2 5] [3 6]] Example 2 Python3 # import the important module in python import numpy as np # make an array with numpy gfg = np.array([[1, 2, 3, 4], [4, 5, 6, 7], [7, 8, 9, 0]]) # applying ndarray.T object geeks = gfg.T print(geeks) Output: [[1 4 7] [2 5 8] [3 6 9] [4 7 0]] The ndarray.T attribute finds its use in machine learning applications where input data needs to be formatted in a certain way for further processing. It does not modify the original array and only returns the view of the transposed array. Create Quiz Comment J jitender_1998 Follow 2 Improve J jitender_1998 Follow 2 Improve Article Tags : Numpy Python-numpy Python numpy-ndarray Explore IntroductionNumPy Introduction5 min readPython NumPy6 min readNumPy Array in Python2 min readBasics of NumPy Arrays4 min readNumpy - ndarray3 min readData type Object (dtype) in NumPy Python3 min readCreating NumPy ArrayNumpy - Array Creation5 min readnumpy.arange() in Python2 min readnumpy.zeros() in Python2 min readNumPy - Create array filled with all ones2 min readNumPy - linspace() Function2 min readnumpy.eye() in Python2 min readCreating a one-dimensional NumPy array2 min readHow to create an empty and a full NumPy array2 min readCreate a Numpy array filled with all zeros - Python2 min readHow to generate 2-D Gaussian array using NumPy?2 min readHow to create a vector in Python using NumPy4 min readPython - Numpy fromrecords() method2 min readNumPy Array ManipulationNumPy Copy and View of Array4 min readHow to Copy NumPy array into another array?2 min readAppending values at the end of an NumPy array4 min readHow to swap columns of a given NumPy array?4 min readInsert a new axis within a NumPy array4 min readnumpy.hstack() in Python2 min readnumpy.vstack() in python2 min readJoining NumPy Array3 min readCombining a One and a Two-Dimensional NumPy Array3 min readNumpy np.ma.concatenate() method-Python2 min readNumpy dstack() method-Python2 min readSplitting Arrays in NumPy6 min readHow to compare two NumPy arrays?2 min readFind the union of two NumPy arrays2 min readFind unique rows in a NumPy array3 min readNumpy np.unique() method-Python2 min readnumpy.trim_zeros() in Python2 min read Like