Post Reply 
Some of Python's linalg commands in HP Prime
09-11-2021, 10:36 AM
Post: #9
RE: Some of Python's linalg commands in HP Prime
(09-11-2021 09:13 AM)robmio Wrote:  Since I had to use the "transpose" command in my Python program, I had to write a subroutine to transpose the arrays ...

Is matrix simply list of list ? If yes, we can transpose with a 1-liner.

>>> transpose = lambda a: [list(r) for r in zip(*a)]
>>> transpose([[1,2,3], [4,5,6]])
[[1, 4], [2, 5], [3, 6]]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Some of Python's linalg commands in HP Prime - Albert Chan - 09-11-2021 10:36 AM



User(s) browsing this thread: 1 Guest(s)