[Python] How to convert matrix to block matrix using Numpy

Discussão em 'Python' iniciado por Stack, Janeiro 3, 2025.

  1. Stack

    Stack Membro Participativo

    Say I have a matrix like

    Matrix = [[A11, A12, A13, A14], [A21, A22, A23, A24], [A31, A32, A33, A34], [A41, A42, A43, A44]],

    and suppose I want to convert it to a block matrix

    [[A,B], [C,D]],

    where

    A = [[A11, A12], [A21, A22]] B = [[A13, A14], [A23, A24]] C = [[A31, A32], [A41, A42]] D = [[A33, A34], [A43, A44]].

    What do I need to type to quickly extract the matrices A, B, C, and D?

    Continue reading...

Compartilhe esta Página