# matrix
```
__ _
__ _ ___ _/ /_____(_)_ __
/ ' \/ _ `/ __/ __/ /\ \ /
/_/_/_/\_,_/\__/_/ /_//_\_\
```
A python package for matrix operations and manipulations.
## Contents
* [Back-Story](#back-story)
* [Features](#features)
* [Installation](#installation)
* [Usage](#usage)
* [Uninstallation](#uninstallation)
* [Contributing](#contributing)
## Back-Story
I had just completed my "Journey through the Docs", studying the Core Python aspect of the Python Docs (majorly the Library & Language References, wherever else those referred me to and whatever else I needed to fully understand things) with interactive sessions, testing things out and making notes.
Then I needed something to put to (real) practice all the things I had learned.
I wanted something purely **Standard** Python, no 3rd-party libraries and seemed this project would be a good place to start.
The project was conceived in the course of my "Journey through the Docs" but only stayed on my TODO list till after.
It's been interesting so far and the project turned out to incoparate a lot of what I had learnt... though, definitely not all. :smile:
**NOTE:** This project is not intended to be a "re-invention of any wheel", it's just me practicing.
I didn't test out or go through any similar project in the course of developing this, in order to stay unbiased and get the best out of it since it was for practice.
## Features
This is just an outline of the major features of the library. For the complete feature list, detailed descriptions and project documentation, see the [documentation](https://anonymoux47.github.io/matrix/).
### Matrix initialization. Via:
* The class constructor
* Utility functions to generate:
* Unit matrices.
* Matrices filled with random integer elements.
* Matrices filled with random floating-point elements.
### Matrix object interactions
* Intelligent string representation
* Subscription
* Single-element indexing, assignment and deletion
* Block-slice (sub-matrix) subscription and assignment.
* Truthiness
* Membership test for elements
* Iteration over elements
* Per-element rounding
### Matrix object properties
* Size
* Number of rows
* Number of columns
* Determinant
* Principal diagonal
* Trace
* Rank
### Matrix Operations
* Negation
* Equality comparison
* Addition and subtraction
* Scalar multiplication
* Matrix multiplication
* Exponentiation (Repeated matrix multiplication)
* Division (by scalar)
* Inverse
* Transpose
* Augmentation
* Row reduction
* Row Echelon form (Forward elimination)
* Reduced Row Echelon form
* Back substitution
### Tests for matrix properties and special matrices
* Diagonality
* Nullity
* Orthogonality
* Squareness
* Symmetry
* Triangularity
* Identity matrix
* Conformability
### Matrix views
These are views of the matrix object, like `.keys()` and `.values()` are to `dict`.
* Rows and Columns (and their slices). Support:
* Single row/column Indexing
* Slicing of multiple rows/columns (Yes, a slice of rows/columns can still be sliced further! :sunglasses:)
* Row/column assignment and deletion (Rows/Columns slices **DO NOT** support these).
* Length (number of rows/columns "in" the view)
* Iteration over rows/columns
* Row and column. Support:
* String representation
* Single element indexing
* Multiple element slicing
* Equality comparison
* Mathematical operations (Also supports augmented assignment of these operations):
* Addition and subtraction of rows and/or columns (Element-wise)
* Multiplication and Division by scalar
* Multiplication and Division by row/column (i.e inter-operation of two rows/columns element-by-element)
* **NOTE:** Augmented assignments of these operations are performed **in-place** i.e affect the matrix itself.
* Row/column length
* Membership tests
* Iteration over elements
### Other operations on matrices
* Horizontal and vertical flip
* Clockwise and anti-clockwise rotation
* Matrix copy
* Matrix resize
* Rounded comparison
### Solutions to systems of linear equations
* Gaussian elimination
* Gauss-Jordan elimination
* Inverse method
## Installation
### Requirements
- Python >= 3.8
### Install from PyPI
NOTE: You must have the `pip` python package installed (usually is, by default)
Run
```sh
pip install matrix-47
```
OR
```sh
python -m pip install matrix-47
```
### Install from source
Download and unzip [this repository](https://github.com/AnonymouX47/matrix/archive/refs/heads/main.zip) or run
```sh
git clone https://github.com/AnonymouX47/matrix
```
Change your Working Directory to the local repository; run
```sh
cd matrix
```
Then, run
```sh
pip install .
```
* * *
Instead, you might run
```sh
python -i test.py
```
to just test out the library without installing the package (but will be limited to only that interactive session).
**NOTE:** On Windows, the Python executables must've been added to `PATH` (For help, check [here](https://datatofish.com/add-python-to-windows-path/)).
## Usage
Quick example:
```python
>>> from matrix import Matrix
>>> print(Matrix(4, 4))
+―――――――――――――――+
| 0 | 0 | 0 | 0 |
|―――+―――+―――+―――|
| 0 | 0 | 0 | 0 |
|―――+―――+―――+―――|
| 0 | 0 | 0 | 0 |
|―――+―――+―――+―――|
| 0 | 0 | 0 | 0 |
+―――――――――――――――+
```
For more usage examples, check the [samples](https://github.com/AnonymouX47/matrix/tree/main/samples).
For the complete feature list and descriptions, see [Feature Description](https://anonymoux47.github.io/matrix/features/).
## Uninstallation
To uninstall the package, run
```sh
pip uninstall matrix-47
```
## Contributing
If you find any bug, please create an **Issue** in the [Issues section](https://github.com/AnonymouX47/matrix/issues).
Please make sure you check other issues first, to make sure you don't create a duplicate. Thank you :smiley:
没有合适的资源?快使用搜索试试~ 我知道了~
用于各种二维矩阵运算和操作的Python库。_Python_Sh.zip
共43个文件
py:15个
md:13个
ipynb:9个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 70 浏览量
2023-04-13
23:41:25
上传
评论
收藏 77KB ZIP 举报
温馨提示
用于各种二维矩阵运算和操作的Python库。_Python_Sh.zip
资源推荐
资源详情
资源评论
收起资源包目录
用于各种二维矩阵运算和操作的Python库。_Python_Sh.zip (43个子文件)
matrix-main
setup.py 1KB
.gitattributes 65B
check 169B
LICENSE 34KB
samples
matrix_initialization.ipynb 14KB
tests_for_matrix_properties_and_special_matrices.ipynb 6KB
matrix_views-1.ipynb 17KB
matrix_object_interactions.ipynb 27KB
matrix_properties.ipynb 18KB
matrix_operations.ipynb 28KB
textconv 524B
matrix_views-2.ipynb 13KB
solutions_to_systems_of_linear_equations.ipynb 3KB
other_operations_on_matrices.ipynb 11KB
README.md 386B
tests
test_utils.py 6KB
test_matrix.py 7KB
matrix
utils.py 12KB
__init__.py 4KB
matrix.py 41KB
components
utils.py 5KB
__init__.py 108B
rows.py 9KB
bases.py 10KB
columns.py 9KB
elements.py 3KB
__version__.py 68B
exceptions.py 1KB
docs
features
other_operations_on_matrices.md 809B
matrix_initialization.md 1KB
solutions_to_systems_of_linear_equations.md 542B
matrix_properties.md 596B
matrix_views.md 4KB
matrix_object_interactions.md 3KB
matrix_operations.md 2KB
index.md 1KB
tests_for_matrix_properties_and_special_matrices.md 686B
_config.yml 26B
reference.md 19B
index.md 311B
.gitignore 428B
test.py 740B
README.md 6KB
共 43 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功