[Numpy-discussion] numpy.linalg or scipy.linalg ?

David Cournapeau david@ar.media.kyoto-u.ac...
Mon Feb 16 07:57:41 CST 2009


Hi Axel,

axel.breuer@bnpparibas.com wrote:
> Hi,
>
> Which one is better numpy.linalg or scipy.linalg ?
>   

scipy.linalg is more complete, but both numpy and scipy may use the
underlying LAPACK available on your platform.

> These modules have some common functions but with different
> help lines.
>   

Yes, there are some redundancy, unfortunately, mostly for historical
reasons I believe.

> Furthermore, numpy.scipy.linalg.svd seems to be more stable
> than numpy.linalg.svd (are they using different LAPACK methods ?)
>   

If both numpy and scipy were built on a machine with BLAS/LAPACK, they
should use the same implementation. One difference is that numpy can be
built without any blas/lapack (and then uses its own implementation).
Which platform are you on ? Did you build numpy/scipy by yourself, or
did you use a pre-built package ? There are many possible different
configurations, unfortunately.

You can also check the underlying detected implementation with show_config:

import numpy as np
import scipy as sc
print np.show_config()
print sc.show_config()

cheers,

David


More information about the Numpy-discussion mailing list