Skip to content

python library dedicated to matrices / 2D arrays

License

Notifications You must be signed in to change notification settings

0xhilSa/matrix.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

matrix.py

A Python library for performing advanced matrix calculations

Implementation

from matrix import Matrix
from matrix import extra

x = Matrix([[1,2,3],[4,5,6]], dtype=int)                     # default symbol = None
y = Matrix([[2,3,4],[5,6,7]], symbol="A")                    # default dtype = float

print(x())                                                   # <'Matrix' object at 0x7fdfc2d87fa0 dtype=int size=6 shape=(2, 3) symbol=None>
print(y())                                                   # <'Matrix' object at 0x7fb588637f10 dtype=float size=6 shape=(2, 3) symbol=A>
print(x.numpy())                                             # array([[1, 2, 3], [4, 5, 6]])
print((x + y)())                                             # <'Matrix' object at 0x7fb544042140 dtype=float size=6 shape=(2, 3) symbol=None>

print(x + y)
"""
Matrix([
    [ 3.00000,  5.00000,  7.00000],
    [ 9.00000, 11.00000, 13.00000]
], dtype=float, symbol=None, shape=(2, 3))
"""

print(extra.entr(x.astype(float)))
"""
Matrix([
    [ -0.00000,  -1.38629,  -3.29584],
    [ -5.54518,  -8.04719, -10.75056]
], dtype=float, symbol=None, shape=(2, 3))
"""

print(extra.exp2(y.astype(float)))
"""
Matrix([
    [  4.00000,   8.00000,  16.00000],
    [ 32.00000,  64.00000, 128.00000]
], dtype=float, symbol=None, shape=(2, 3))
"""

Installation Instruction

  1. clone this repo
git clone "https://github.com/Sahil-Rajwar-2004/matrix.py.git"
  1. navigate to matrix directory that you just downloaded/cloned

  2. see below instruction for different OS

Windows Users

  1. If you are on Window OS then run the install.ps1 script
pwsh install.ps1

OR Linux / MacOS Users

  1. If you are on Linux / MacOS then run the install.sh script
bash install.sh

Contributing

I am currently the sole developer and maintainer of this project. While contributions are welcome, please reach out before starting any major work to ensure that your ideas align with the project's goals. You can open a discussion or contact me directly through the repository.

Reporting Issues

If you encounter any issues or bugs while using the library, please report them by opening an issue on the GitHub repository. Include a detailed description of the problem, steps to reproduce it, and any relevant error messages or screenshots.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

About

python library dedicated to matrices / 2D arrays

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages