From: Bill B. <wb...@gm...> - 2006-02-20 06:48:46
|
Ack. I may be able to get references to lu, lu_factor, et al, but they don't actually work with numpy arrays: from scipy.linalg import lu,lu_factor,lu_solve import scipy as S A =3D S.rand(2,2) lu(A) Traceback (most recent call last): File "<input>", line 1, in ? File "C:\Python24\Lib\site-packages\scipy\linalg\decomp.py", line 249, in lu flu, =3D get_flinalg_funcs(('lu',),(a1,)) File "C:\Python24\Lib\site-packages\scipy\linalg\flinalg.py", line 30, in get_flinalg_funcs t =3D arrays[i].dtypechar AttributeError: 'numpy.ndarray' object has no attribute 'dtypechar' Ok, so, once again, does anyone have an lu_factor / lu_solve implementation in python that I could borrow? Apologies for the monologue. --bb On 2/20/06, Bill Baxter <wb...@gm...> wrote: > > Upon further inspection I find that if I call 'from scipy import *' then > linalg.lu etc are defined. > But if I do anything else to import scipy like 'import scipy' or 'import > scipy as S' or 'from scipy import linalg', then lu, cg etc are not define= d. > > > Why is that? > > I can get at them without importing * by doing 'from scipy.linalg import > lu', but that's kind of odd to have to do that. > > --bb > > On 2/20/06, Bill Baxter <wb...@gm...> wrote: > > > > This url http://www.rexx.com/~dkuhlman/scipy_course_01.html<http://www.= rexx.com/%7Edkuhlman/scipy_course_01.html>seems to keep turning up in my se= arches for numpy and scipy things, > > but many of the linalg operations it lists don't seem to exist in recen= t > > versions of numpy (or scipy). > > > > Some of them are: > > > > * norm > > * factorizations: lu, lu_factor, lu_solve, qr > > * iterative solvers: cg, cgs, gmres etc. > > > > Did these things used to exist in Numeric but they haven't been ported > > over? Will they be re-introduced sometime? > > > > In the short term, the one I'm after right now is LU decompose and solv= e > > functionality. Anyone have a numpy implementation? > > > > --Bill Baxter > > > |