Post Reply 
Some of Python's linalg commands in HP Prime
09-11-2021, 11:17 AM
Post: #10
RE: Some of Python's linalg commands in HP Prime
(09-11-2021 10:36 AM)Albert Chan Wrote:  
(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]]

Congratulations! This short solution you proposed works very well in my program
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 - robmio - 09-11-2021 11:17 AM



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