[SciPy-user] Right way to import scipy

Bill Baxter wbaxter at gmail.com
Mon Feb 20 19:59:30 CST 2006

I posted this on the numpy list, but it seems more a scipy issue.

If you do this:

import numpy as N
import scipy as S

Then S.linalg looks to be identical to N.linalg.  In particular it doesn't
have things like lu, qr, gmres, etc.

If you subsequently do 'from scipy.linalg import lu', then suddenly
S.linalglooks different from
N.linalg, and it has not just lu, but all the other scipy linalg goodies

Is this a bug?  I would like to add info about getting at these functions to
the Scipy for Matlab Users wiki page, but I'd like to know first if
A) this is the expected behavior, or just a bug and
B) if these import statements are really the best way to get at
scipy.linalg.lu et al.
   import numpy as N
   import scipy as S
   from scipy.linalg import lu

(This is with Numpy 0.9.5 and Scipy 0.4.6.  With numpy 0.9.4/scipy 0.4.4 the
above imports make scipy.linalg.lu et al accessible, but they throw
exceptions trying to access ndarray.dtypechar when you try to use them.)

Bill Baxter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.scipy.net/pipermail/scipy-user/attachments/20060221/3b5cb831/attachment.htm

More information about the SciPy-user mailing list