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.

enter image description here

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

Popular posts from this blog

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -