25 May 2012 25 May '12
I have an array, x, with dimensions (K,M,M). I would like to compute a new array, y ~ (K,M*(M+1)/2), such that
y[k] = numpy.tril(x[k]).flatten() for each k = 0,..,K-1
Is there a way to do this without looping? I was trying with tril_indices but couldn't quite get the logic right.