Skip to main content

Matrix and Vector Manipulation library

Project description

Matrix7

a library in pure python3 that allows you to use matrices and vectors easily

Setup

sudo pip install matrix7

How to use

Declarations

from matrix7 import Matrix, Vector

a = Matrix([
    [1,2,3,4,5,6,7],
    [101,102,103,104,105,106,107],
    [201,202,203,204,205,206,207],
])

b = Vector( [2,4,7,9] )

c = Vector( [2,4,7,9] , transpose = True )

printing

  • print(a) :
|   1.00   2.00   3.00   4.00   5.00   6.00   7.00 |
| 101.00 102.00 103.00 104.00 105.00 106.00 107.00 |
| 201.00 202.00 203.00 204.00 205.00 206.00 207.00 |
  • print(b) :
|   2.00 |
|   4.00 |
|   7.00 |
|   9.00 |
  • print(c) :
|   2.00   4.00   7.00   9.00 |

properties

a.size    # (nb lines, nb cols)
a.trace   # only for nxn matricies
a.raw     # matrix or vector in normal python list format
a.gravity # only for vectors

operations

  • normal python operations are used
  • Matrix or Vector object is returned
  • regular matrix/vector calculation rules apply
c = a + b
c = a - b
c = a * b

trasponse of matrix or vector

a.transpose()

generation

# vector containing 6 threes
vect = Vector.gen(6, 3)

# 3x4 matrix of zeroes
mat = Matrix.gen(3, 4, 0)

navigation

# matrix line 0 (Vector) or vector element (int, float ..etc)
a[0]
# matrix column 0 (Vector)
a(0)
# matrix element (0,0) (int, float ..etc)
a[0][0]

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

matrix7-1.2.0.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

matrix7-1.2.0-py3-none-any.whl (15.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