A python package that retrieves matrix dimensions, their trace, and performs matrix addition, subtraction, multiplication.
Project description
py-Matrix-123
Installation
To install with pip, run: pip install py-Matrix-123
Basic Usage
You can retrieve matrix dimensions, their trace, and performs matrix addition, subtraction, multiplication and scalar multiplication.
requirements: python3
Here's an example for regular matrices
from pymatrix123 import Matrix
"""
matrix A:
1
3
4
5
matrix B:
1
0
2
5
"""
matrixA = Matrix([[1], [3], [4], [5]])
matrixB = Matrix([[1], [0], [2], [5]])
print(matrixA + matrixB)
Here's an example for square matrices
from pymatrix123 import SquareMatrix
"""
matrix A:
1 2
3 4
matrix B:
3 4
2 1
"""
matrixA = SquareMatrix([[1, 2], [3, 4]])
matrixB = SquareMatrix([[4, 3], [2, 1]])
print(matrixA.trace())
print(matrixA.get_dim())
print(matrixB.trace())
print(matrixB.get_dim())
print(matrixA * matrixB)
Reference
Setup | Command | Notes |
---|---|---|
install | pip install pymatrix123 |
Creating a CLI | Command | Notes |
---|---|---|
import | import pymatrix123 |
|
Call | Matrix(A) |
Turns the current list into a matrix object. |
Call | SquareMatrix(B) |
Turns the current list into a matrix object. |
License
Licensed under the The Python Packaging Authority License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
py-Matrix-123-0.0.3.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for py_Matrix_123-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74d6cb800107e39d036a500bde0cf14c084a3f1c882cfb40ffaccc25294e02ca |
|
MD5 | f0c5b3b1391cb38fc2b7146d1dc0c593 |
|
BLAKE2b-256 | cd3343852928eb354ddf7abfe99e87c02a3f5783d9fb9c480c6771879a4504fd |