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

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -