Additional linear algebra operations to extend Joel Grus's library from 'Data Science from Scratch' chapter 4
Project description
Linalg Deluxe
An extension of Joel Grus's linear algebra Python library as he wrote it in chapter 4 of Data Science from Scratch. I have added transposition, symmetry checking, multiplication of vectors by matrices, the angle between two vectors, outer products, cross products, matrix multiplication, determinants, adjoint matrices, and inverse matrices (plus some input-checking helper functions).
Installation
pip install linalg-basic
pip install linalg-deluxe
Get started
The following code walks through just a few of the library's features:
from linalg_deluxe.linalg_deluxe import transpose, multiply_matrix_vector, symmetric, inverse_matrix
# Create a Vector and a Matrix (the two data types the library runs on)
v = [1, 2, 3]
m = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
# Transpose v and m
v_vertical = transpose(v)
m_transposed = transpose(m)
# Multiply m by v
m_x_v = multiply_matrix_vector(m, v)
# Is m symmetric?
m_sym = symmetric(m)
# Attempt to generate m's inverse
# This will fail, because m's determinant is not zero in this case
m_inv = inverse_matrix(m)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file linalg_deluxe-0.1.3.tar.gz.
File metadata
- Download URL: linalg_deluxe-0.1.3.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25d927b61d3b89675fff8a6fc3a798d72cc1ba34464632311c97f76d84c2a0b7
|
|
| MD5 |
1ebaa08f2114cf55cb2b8a2b8ecf574b
|
|
| BLAKE2b-256 |
2fde0e88687e74125365bfc79f14714dabcf2b7fcf607d8aefc8ab82ba9d894d
|
File details
Details for the file linalg_deluxe-0.1.3-py3-none-any.whl.
File metadata
- Download URL: linalg_deluxe-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee2ea41e6061833d5eb28fe8d4f7da13efeb841344c5e27a99fb88aabbddeec5
|
|
| MD5 |
cab084e9735c679b727632e03bc35f34
|
|
| BLAKE2b-256 |
6994ef30b0a21ea37c36d297cbddddc265c2ac84710e6c60df0045fe2f2b4786
|