pymatops - A Python package for Matrix Operations
Package Details
The pymatops package is available on the official Python Package Index (PyPi) repository.
It can be installed and used in your projects by running the following command using pip
pip install pymatops
Package Operations
1. visualize - visualize a matrix
import pymatops as pmo
mat = [[1,2,3], [4,5,6], [7,8,9]]
pmo.visualize(mat)
2. dim - returns a tuple with the dimensions of the matrix
import pymatops as pmo
mat = [[1,2,3], [4,5,6], [7,8,9]]
print("The dimension of the matrix is ", pmo.dim(mat))
3. randomMatrix - returns a matrix of random dimensions with random values if the function is called with no arguments
import pymatops as pmo
print("The randomly generated matrix: ")
pmo.randomMatrix()
4. randomMatrix - you can pass dimensions to get a matrix of specified dimensions with random values. Both row and col dimensions are required
import pymatops as pmo
print("The random matrix of dimension 6*8 generated: ")
pmo.randomMatrix(6,8)
5. matSum - returns the sum of all elements in the matrix passed
import pymatops as pmo
print("The random matrix generated: ")
mat = pmo.randomMatrix(6,8) # retuns a 6*8 matrix with random values
print("The sum of the matrix: ", pmo.matSum(mat))
6. matAdd - returns the resultant matrix of the sum of matrix A and B
import pymatops as pmo
mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
mat1 =[[1, 2, 3], [4, 5, 6], [7, 8, 9]] # returns a 6*8 matrix with random values
print("Matrix 1:")
pmo.visualize(mat)
print("Matrix 2:")
pmo.visualize(mat1)
print("The resultant matrix of the matrix addition operation: ")
pmo.matAdd(mat, mat1)
7. matMul - returns the resultant matrix of the multiplication of matrix A and B
import pymatops as pmo
mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]] # matrix of dimensions 4*3
mat1 =[[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]] # matrix of dimensions 3*4
print("Matrix 1:")
pmo.visualize(mat)
print("Matrix 2:")
pmo.visualize(mat1)
print("The resultant matrix of the matrix multiplication operation: ")
pmo.matMul(mat, mat1)
8. scalarMul - returns the resultant matrix of the multiplication of matrix A with scalar c
import pymatops as pmo
mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
print("Original Matrix: ")
pmo.visualize(mat)
print("Matrix after scalar multiplication operation: ")
pmo.scalarMul(mat, 3)
9. transpose - returns transpose of matrix
import pymatops as pmo
mat = [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]]
print("Original Matrix: ")
pmo.visualize(mat)
print("Matrix after transpose operation: ")
pmo.transpose(mat)
10. zeroElements - returns the number of zero elements in the matrix
import pymatops as pmo
mat = [[1, 0, 3], [0, 5, 6], [7, 8, 0], [10, 11, 12]]
print("Original Matrix: ")
pmo.visualize(mat)
print("Number of zeros in the matrix: ", end = " ")
print(pmo.zeroElements(mat))
11. evenCheck - returns a tuple with the first element as the number of even numbers in the matrix and the second element being the number of odd numbers in the matrix
import pymatops as pmo
mat = [[1, 0, 3], [0, 5, 6], [7, 8, 0], [10, 11, 12]]
print("Original Matrix: ")
pmo.visualize(mat)
print("Number of even numbers in the matrix: ", end = " ")
print(pmo.evenCheck(mat)[0])
print("Number of odd numbers in the matrix: ", end = " ")
print(pmo.evenCheck(mat)[1])
Metadata
Release files for pymatops 1.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pymatops-1.3.1.tar.gz | 4.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pymatops-1.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.1 kB
Release files / pymatops-1.3.1.tar.gz
| Download URL | pymatops-1.3.1.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e166fdc125ee26ebf7d80374a428c49271061a23fce5bf69ce32a5c519df97d2
|
|
BLAKE2b-256 checksum How to use checksums |
7a054928818bd556f82f76a1e3824de6a5b6ab33a2215a2619c69571702e6273
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.2
|
Release files / pymatops-1.3.1-py3-none-any.whl
| Download URL | pymatops-1.3.1-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c62cc0c07aaa4f77460fcbd06fb2f4c9e15b8fe519b81b3ea89381ab95c7773e
|
|
BLAKE2b-256 checksum How to use checksums |
1dd04edf6646b5729e75a970067288b0a58de39560f5000f21f013c252094f55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.2
|
Security for pymatops 1.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.