Linear Algebra for nocturnal and adventurous data scientists.
Lana is simply a repository for testing Python/Rust bindings and reproducing, on a micro scale, some of the functionalities of the great NumPy package. It's a work-in-progress memetic project aimed at having fun and learning new things.
Make sure you have the Rust language toolchain (cargo) installed on your machine, and then:
pip install lana
To build a package wheel, run the following command:
pip install maturin
git clone https://github.com/marcosalvalaggio/lana.git
cd lana
maturin build --sdist
maturin develop
from lana import Matrix, inject
zeros = Matrix.zeros((3,3))
print(zeros)
print(f"shape: {zeros.shape}, type: {type(zeros)}")
print(zeros.to_list()[0], zeros.to_list()[0][0])
mat = Matrix.matrix([[1,2,3],[4,5,6]])
print(mat)
print(f"shape: {mat.shape}, type: {type(mat)}")
for rows in mat.to_list():
print(rows, type(rows))
submat = Matrix.matrix(inject(mat.to_list()[0]))
print(submat)
print(submat.shape, type(submat))