Numpy: converte um array em uma matriz triangular

Eu estava procurando um método embutido para converter uma matriz linear para matriz triangular. Como falhei em encontrar um, estou pedindo ajuda para implementar um.

Imagine uma matriz como:

In [203]: dm
Out[203]: array([ 0.80487805,  0.90243902,  0.85365854, ...,  0.95121951,
                  0.90243902,  1.        ])

In [204]: dm.shape
Out[204]: (2211,)

E eu gostaria de converter essa matriz para uma matriz triangular ou uma matriz retangular simétrica.

 In [205]: reshapedDm = dm.trian_reshape(67, 67)

Como eu implementaria trian_reshape como função que retorna uma matriz triangular da matriz 1-D?

questionAnswers(1)

yourAnswerToTheQuestion