Alternative to scipy and numpy for linear algebra?

I hear you, I have been there as well. Numpy/scipy are really wonderful libraries and it is a pity that installation problems get somewhat often in the way of their usage.

Also, as far as I understand there are not very many good (easier to use) options either. The only possibly easier solution for you I know about is the "Yet Another Matrix Module" (see NumericAndScientific/Libraries listing on python.org). I am not aware of the status of this library (stability, speed, etc.). The possibility is that in the long run your needs will outgrow any simple library and you will end up installing numpy anyway.

Another notable downside on using any other library is that your code will potentially be incompatible with numpy, which happens to be the de facto library for linear algebra in python. Note also that numpy has been heavily optimized - speed is something you are not guaranteed to get with other libraries.

I would really just put more effort on solving the installation/setup problems. The alternatives are potentially much worse.


I'm surprised nobody mentioned SymPy, which is written entirely in Python and does not require compilation like Numpy.

There is also tinynumpy, which is a pure python alternative to Numpy with limited features.


Given your question, I decided just factor out the matrix code from where I were using it, and put it in a publicly accessible place -

So, this is basically a pure python ad-hoc implementation of a Matrix class which can perform addition, multiplication, matrix determinant and matrix inversion - should be of some use -

Since it is in pure python, and not worried with performance at all it unsuitable for any real calculation - but it is good enough for playing around with matrices in an interactive way, or where matrix algebra is far from being the critical part of the code.

The repository is here, https://bitbucket.org/jsbueno/toymatrix/

And you can download it straight from here: https://bitbucket.org/jsbueno/toymatrix/downloads/toymatrix_0.1.tar.gz

Tags:

Python