# numpy.ndarray.T – The NumPy ndarray.T

## Introduction to NumPy ndarray.T

We may build a Transpose of an array with a size larger than or equal to 2 using the Numpy ndarray.T object.

Syntax:

`ndarray.T`

Return: It returns Transpose of an array

## Code Examples of NumPy ndarray.T

Example 01: We can see in this example that we may convert an array with the help of the ndarray.T object.

``````# welcome to softhunt.net
# import the important module in python
import numpy as np

# make an array with numpy
arr = np.array([[1, 3, 5], [2, 4, 6]])

# applying ndarray.T object
softhunt = arr.T

print(softhunt)``````

Output:

```[[1 2]
[3 4]
[5 6]]```

Example 02:

``````# welcome to softhunt.net
# import the important module in python
import numpy as np

# make an array with numpy
arr = np.array([[1, 4, 7, 10], [2, 5, 8, 11], [3, 6, 9, 12]])

# applying ndarray.T object
softhunt = arr.T

print(softhunt)``````

Output:

```[[ 1  2  3]
[ 4  5  6]
[ 7  8  9]
[10 11 12]]```

Note: These programs will not run in online IDEs. Please test them on your systems to see how they operate.

## FAQs

### What is capital T in Python OR String capitalize() in Python?

The capitalise() function in Python produces a duplicate of the original string with the first character converted to a capital (uppercase) letter and all remaining characters in the string converted to lowercase letters.

Syntax:

`string_name.capitalize()`

string_name: It is the name of a string whose first character we want to capitalize.

Parameters: The capitalize() function does not take any parameter.

Return: The capitalize() function returns a string with the first character in the capital.

### How do I transpose in NumPy?

We may do the simple operation of transposing inside one line by utilizing Numpy’s numpy.transpose() function. Although it can transpose 2-D arrays, it has no effect on 1-D arrays. The 2-D NumPy array is transposed using this approach.

### What is a NumPy Ndarray?

The ndarray, which is a shorthand term for N-dimensional array, is the most important data structure in NumPy. The data in a ndarray is simply referred to as an array when dealing with NumPy. It’s a memory array with data of the same type, such as integers or floating-point values, that’s fixed in size.

## NumPy ndarray.T: Conclusion

That’s all for this article, if you have any confusion contact us through our website or email us at [email protected] or by using LinkedIn. And make sure you check out our NumPy tutorials.

Suggested Articles:

1. numpy.swapaxes() – The NumPy swapaxis Python Function