From: Seweryn K. <sk...@po...> - 2006-11-13 17:00:26
|
Hello, Why ipython and python interactive shell give two different information? --- ipython Python 2.4.4 (#2, Oct 20 2006, 00:23:25) Type "copyright", "credits" or "license" for more information. IPython 0.7.2 -- An enhanced Interactive Python. ? -> Introduction to IPython's features. %magic -> Information about IPython's 'magic' % functions. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. In [1]: from scipy import linalg In [2]: help(linalg.eig) Help on function eig in module numpy.linalg.linalg: eig(a) eig(a) returns u,v where u is the eigenvalues and v is a matrix of eigenvectors with vector v[:,i] corresponds to eigenvalue u[i]. Satisfies the equation dot(a, v[:,i]) = u[i]*v[:,i] --- ipython while --- python Python 2.4.4 (#2, Oct 20 2006, 00:23:25) [GCC 4.1.2 20061015 (prerelease) (Debian 4.1.1-16.1)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from scipy import linalg >>> help(linalg.eig) Help on function eig in module scipy.linalg.decomp: eig(a, b=None, left=False, right=True, overwrite_a=False, overwrite_b=False) Solve ordinary and generalized eigenvalue problem of a square matrix. Inputs: a -- An N x N matrix. b -- An N x N matrix [default is identity(N)]. left -- Return left eigenvectors [disabled]. right -- Return right eigenvectors [enabled]. overwrite_a, overwrite_b -- save space by overwriting the a and/or b matrices (both False by default) Outputs: w -- eigenvalues [left==right==False]. w,vr -- w and right eigenvectors [left==False,right=True]. w,vl -- w and left eigenvectors [left==True,right==False]. w,vl,vr -- [left==right==True]. Definitions: ... --- python Any idea? regards SK |
From: Charles R H. <cha...@gm...> - 2006-11-13 19:13:25
|
On 11/13/06, Seweryn Kokot <sk...@po...> wrote: > > Hello, > > Why ipython and python interactive shell give two different information? > > --- ipython > Python 2.4.4 (#2, Oct 20 2006, 00:23:25) > Type "copyright", "credits" or "license" for more information. > > IPython 0.7.2 -- An enhanced Interactive Python. > ? -> Introduction to IPython's features. > %magic -> Information about IPython's 'magic' % functions. > help -> Python's own help system. > object? -> Details about 'object'. ?object also works, ?? prints more. > > In [1]: from scipy import linalg > > In [2]: help(linalg.eig) > > Help on function eig in module numpy.linalg.linalg: > > eig(a) > eig(a) returns u,v where u is the eigenvalues and > v is a matrix of eigenvectors with vector v[:,i] corresponds to > eigenvalue u[i]. Satisfies the equation dot(a, v[:,i]) = > u[i]*v[:,i] > --- ipython > > while > > --- python > Python 2.4.4 (#2, Oct 20 2006, 00:23:25) > [GCC 4.1.2 20061015 (prerelease) (Debian 4.1.1-16.1)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from scipy import linalg > >>> help(linalg.eig) > > Help on function eig in module scipy.linalg.decomp: > > eig(a, b=None, left=False, right=True, overwrite_a=False, > overwrite_b=False) > Solve ordinary and generalized eigenvalue problem > of a square matrix. > > Inputs: > > a -- An N x N matrix. > b -- An N x N matrix [default is identity(N)]. > left -- Return left eigenvectors [disabled]. > right -- Return right eigenvectors [enabled]. > overwrite_a, overwrite_b -- save space by overwriting the a and/or > b matrices (both False by default) > > Outputs: > > w -- eigenvalues [left==right==False]. > w,vr -- w and right eigenvectors [left==False,right=True]. > w,vl -- w and left eigenvectors [left==True,right==False]. > w,vl,vr -- [left==right==True]. > > Definitions: > ... > --- python > > Any idea? I expect scipy.linalg and numpy.linalg are different modules containing different functions. That said, the documentation in scipy.linalg looks quite a bit more complete. Chuck |
From: Sven S. <sve...@gm...> - 2006-11-14 09:51:17
|
Charles R Harris schrieb: > In [1]: from scipy import linalg > > In [2]: help(linalg.eig) > > > >>> from scipy import linalg > >>> help(linalg.eig) > > Help on function eig in module scipy.linalg.decomp: > > > I expect scipy.linalg and numpy.linalg are different modules containing > different functions. That said, the documentation in scipy.linalg looks > quite a bit more complete. > > Chuck Sure, but Seweryn used the same import statement from scipy and never explicitly referred to numpy, so there must be some subtle import voodoo going on. Or did you not show us everything, Seweryn? -sven |
From: Seweryn K. <sk...@po...> - 2006-11-14 10:01:45
|
Sven Schreiber <sve...@gm...> writes: > > Sure, but Seweryn used the same import statement from scipy and never > explicitly referred to numpy, so there must be some subtle import voodoo > going on. Or did you not show us everything, Seweryn? It's all ok now, It was my mistake. The problem was that in ipython I typed "from scipy import linalg" which is wrong and being surprised by the output I open python shell and tried different combinations of import, among others "from scipy import *" and this is the reason of the difference. So now in ipython I get the same output when typing help(linalg.eig). Sorry for bothering you, regards, SK |