Skip to content

Experimental Linear Algebra library written in Rust

License

Notifications You must be signed in to change notification settings

marcosalvalaggio/lana

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lana 🧶

maintenance-status

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.

Install

Make sure you have the Rust language toolchain (cargo) installed on your machine, and then:

pip install lana

Manual Build

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

Example

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))

Releases

No releases published

Packages

No packages published