Horje
transpose matrix in python without numpy Code Example
transpose matrix in python without numpy
def transpose(matrix):
    rows = len(matrix)
    columns = len(matrix[0])

    matrix_T = []
    for j in range(columns):
        row = []
        for i in range(rows):
           row.append(matrix[i][j])
        matrix_T.append(row)

    return matrix_T
  
transpose of a matrix in python numpy
np.transpose(x)
array([[0, 2],
       [1, 3]])
Source: numpy.org




Python

Related
.first() in django Code Example .first() in django Code Example
crawl a folder python Code Example crawl a folder python Code Example
get next multiple of a number Code Example get next multiple of a number Code Example
Small Python Game Code Example Small Python Game Code Example
keras conv2d batchnorm Code Example keras conv2d batchnorm Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7