Many thanks for your replies. Yes, this problem is surely solved by keeping track of namespaces.
However my problem was more of a philosophical than a practical one:), It would be somehow more helpful if important sage components like simpy and scipy are compatible by default and one does not have to play with namespaces. On Mar 5:53 am, Tobias Katz <[email protected]> wrote: > Hi, > > I think you are getting trouble because you are mixing two namespaces. > If you separate both packages, > for example like this: > > import sympy as sp > import scipy as sc > > you can choose which namespace you want to pick a function from by > saying: > > f=sp.Function("f") > x=sp.Symbol('x') > eqn=sp.diff(f(x),x) > > By the way, your example would work, just by changing the order of your > imports, but this would be not a clean way to solve the problem. > > Cheers, > Tobi > > On Fri, 26 Mar 2010 00:19:01 -0700 (PDT) > > dabu <[email protected]> wrote: > > In sage if we use, > > > from sympy import * > > f=Function("f") > > x=Symbol('x') > > eqn=diff(f(x),x) > > > things work fine. > > > However same thing with : > > from scipy import * > from sympy import * > > f=Function("f") > x=Symbol('x') > eqn=diff(f(x),x) > > > > > gives following stack trace: > > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > File "_sage_input_118.py", line 9, in <module> > > open("___code___.py","w").write("# -*- coding: utf-8 -*-\n" + > > _support_.preparse_worksheet_cell(base64.b64decode("ZXFuPWRpZmYocCh4KSx4KQ=="),globals()) > > +"\n"); execfile(os.path.abspath("___code___.py")) > > File "", line 1, in <module> > > > File "/tmp/tmpSyvbFD/___code___.py", line 2, in <module> > > eqn=diff(p(x),x) > > File "", line 1, in <module> > > > File "/home/pallab/sage/sage-4.3.3-linux-32bit-ubuntu_9.10-i686- > > Linux/local/lib/python2.6/site-packages/numpy/lib/function_base.py", > > line 1066, in diff > > slice1[axis] = slice(1, None) > > IndexError: list assignment index out of range > > > Is it possible to use these two packages simultaneous ? -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org To unsubscribe from this group, send email to sage-support+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
