The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
How to use python linalg module?
05-20-2021, 12:02 PM (This post was last modified: 05-20-2021 12:17 PM by kilasuelika.)
Post: #1
How to use python linalg module?
Update:

It looks like that a 2d list can be automatically recognized as a matrix.

Code:

m1=[[1,2],[3,4]]
m2=[[3],[4]]
print(matmul(m1,m2))
will produce
Code:

[[11.0],[25.0]]
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
I don't know how to create a matrix with python linalg module.

Code:

from linalg import *
m=matrix(3,3)
m=matrix([1,2,3,4],2,2)
m=matrix([1,2,3,4],(2,2))
m=matrix([1,2,3,4],2)

All won't work.

What's more,
Code:

print(dir(matrix))

Only shows:
Code:

['__class__']

Then it looks like that matrix doesn't have any member function.

If use arange function:
Code:

m=arange(0,10)
Then m is actually a list object, not a matrix.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
How to use python linalg module? - kilasuelika - 05-20-2021 12:02 PM



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