Given the parameters
n
and m
, I'd like to initialize a n x n
4D array where each entry is an m x m
matrix, and where each column of the matrix is an array of type numpy.linspace(0,1,m)
. Furthermore, I'd only like to have entries on the diagonal and above it, or only on the diagonal and below it. Is there a possible one-liner for this?