Matrix on class
Project description
Matrix Class
This is a Python project that implements a matrix using classes.
Installation
Use the package manager pip to install matrix_class.
pip install matrix_class
Usage
from matrix import Matrix
# Create a new Matrix with 3 rows and 3 columns
m = Matrix(3, 3)
# Set the value of the cell at the first row and first column to 1.0
m[0, 0] = 1.0
# Get the value of the cell at the first row and first column
value = m[0, 0]
# Get the number of rows and columns
rows = m.rows
columns = m.columns
# Print the matrix
print(m)
# Calculate the determinant of the matrix
det = m.det
# Add two matrices
m1 = Matrix(3, 3)
m2 = Matrix(3, 3)
m3 = m1 + m2
# Subtract two matrices
m4 = m1 - m2
# Multiply matrix by a number
m5 = m1 * 2
# Multiply two matrices
m6 = m1 * m2
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
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
matrix_class-0.1.4.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for matrix_class-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8051a65e16179453a3efff9e9b9ab43adce3b5e233ed56c2f7ca076d4490500b |
|
MD5 | 99383cb49096068c1fcf691d8a9c3f8a |
|
BLAKE2b-256 | 413f8f1c79cfb92b8d09e8d3e75df470252bccdc9ccfce3755f3904659b235c0 |