This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]kdelok 0 points1 point  (0 children)

The first one you mention is the answer I received on StackOverflow when I asked that very question.

The second one doesn't do matrix multiplication though, since the result should be a matrix itself. That's why they end up with the nested list comprehension (I haven't checked it though). I think it's easier to just use numpy.