Permutation matrix multiplication in Python

sandeepkamra
Goto Top
I'm a beginner in Python and i tried looking up - https://www.scaler.com/topics/matrix-multiplication-in-python/ and i think i cannot seem to understand it well, so wanted to understand the concept of Permutation matrices. A and B are square and contain only a single 1 in each row. All of the rows are unique. I've added my first attempt as an answer.



I hope someone has a faster solution to this. Thanks in advance!

Content-Key: 3388232208

Url: https://administrator.pro/contentid/3388232208

Printed on: August 16, 2022 at 22:08 o'clock

Member: max
Solution max Jul 26, 2022 updated at 21:29:04 (UTC)
Goto Top
Hi,

I think you should have a look at itertools: https://docs.python.org/3/library/itertools.html


max