Answers for "transpose of a matrix in python numpy"

6

transpose matrix numpy

>>> a = np.array([[1, 2], [3, 4]])
>>> a
array([[1, 2],
       [3, 4]])
>>> a.transpose()
array([[1, 3],
       [2, 4]])
>>> a.transpose((1, 0))
array([[1, 3],
       [2, 4]])
>>> a.transpose(1, 0)
array([[1, 3],
       [2, 4]])
Posted by: Guest on November-03-2020
0

transpose matrices numpy

import numpy as np

A = [1, 2, 3, 4]
np.array(A).T # .T is used to transpose matrix
Posted by: Guest on May-23-2020
0

transpose of a matrix in python numpy

np.transpose(x)
array([[0, 2],
       [1, 3]])
Posted by: Guest on October-13-2021

Code answers related to "transpose of a matrix in python numpy"

Python Answers by Framework

Browse Popular Code Answers by Language