Skip to main content

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

MIT

Project details


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)

Uploaded Source

Built Distribution

matrix_class-0.1.4-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page