[SciPy-user] Proper Use of NumPy's eig()

Steve Lianoglou lists.steve@arachnedesign....
Tue Feb 27 14:48:42 CST 2007


> If you're really keen on having short names for things you could use
>
> 	from scipy.linalg import eig
>
> or
>
> 	import scipy.linalg as L
>
> in the latter case you'd use L.eig().  I personally don't like
> cluttering up the namespace too much but I think that's my own
> obsessive streak. :)

And if you just want all of the functions in the scipy.linalg module  
to enter the global namespace, you can do:

from scipy.linalg import *
# ...
eigE = eig(E)

Typically, this approach isn't recommended when you're writing code,  
but if you're just exploring data in the shell and feel like the the  
module prefixes are too much of a hassle for you to keep typing, this  
is your other option.

-steve



More information about the SciPy-user mailing list