[SciPy-user] Easy way to make a block diagonal matrix?

Stéfan van der Walt stefan@sun.ac...
Wed May 20 17:16:09 CDT 2009


2009/5/20 Joshua Stults <joshua.stults@gmail.com>:
> Probably numpy.kron() already provides this functionality plus easily
> generating more general block matrices:
>
> http://docs.scipy.org/doc/numpy/reference/generated/numpy.kron.html

numpy.kron takes two arrays as input, so I'm not sure how that could
work, especially for diagonal blocks with varying shapes?  Would you
use object arrays? Could be that my brain has gone to bed already!

Regards
Stéfan


More information about the SciPy-user mailing list