Skip to main content

Matrix Operations

Project description

matops is a Python package to perform basic matrix operations.

Examples:

Addition:

from matops import Matrix

m1 = Matrix(
    [
        [1, 2],
        [3, 4],
    ]
)

m2 = Matrix(
    [
        [5, 6],
        [7, 8],
    ]
)

m3 = m1 + m2

print(m3)
[[6, 8], [10, 12]]

You can use prettify() method to print it in a more readable format.

m3.prettify()
[6, 8]
[10, 12]

Transpose:

from matops import Matrix

m = Matrix(
    [
        [1, 2],
        [3, 4],
    ]
)

m.transpose().prettify()
[1, 3]
[2, 4]

List of available methods in Matrix class:

  • prettify()
  • transpose()
  • is_row_matrix()
  • is_column_matrix()
  • is_rectangular_matrix()
  • is_square_matrix()
  • is_zero_matrix()
  • is_symmetric_matrix()
  • is_skew_symmetric_matrix()
  • is_diagonal_matrix()
  • is_scalar_matrix()
  • is_identity_matrix()

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

matops-0.1.0.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

matops-0.1.0-py2.py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 2 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