1D vector from lower part of diagonal in matrix [Python] -
i struggeling pretty easy thing unfortunatelly cannot solve it. have matrix 64x64 elements can see on image. reds zeros , greens values interested in.
i end lower triangular part under diagonal (green values) 1 array.
i use python 2.7
thank lot,
michael
assuming can pull data numpy array, use tril_indices
function. looks data doesn't include main diagonal can shift -1
data = np.arange(4096).reshape(64, 64) inds = np.tril_indices(64, -1) vals = data[inds]
Comments
Post a Comment