Retrieving and flattening lower triangular components of inner axes of 3d array

25 May
2012
25 May
'12
4:19 p.m.
Hi List,
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.
Thanks, dm
4029
Age (days ago)
4029
Last active (days ago)
0 comments
1 participants
participants (1)
-
Damien Moore