Skip to content Skip to sidebar Skip to footer

Extracting Column From Matrix

Alright so I was just wondering how I would extract a column from a matrix. This would be using a user defined in function. so for example: D = [[2,9], [5,2], [1,0]] def col(B,j):

Solution 1:

def col(B,j):
    Z=[]
    for i in range(len(B)):
        Z.append(B[i][j])
    return Z

Post a Comment for "Extracting Column From Matrix"