[sage-support] manipulating dictionaries (bug?)

2008-11-04 Thread Stan Schymanski
Dear all, I tried to store sets of parameter values for plotting in dictionaries, but the dictionaries do not seem independent. If I delete an entry in one, it disappears in the other one, too. Am I doing something wrong or is this a bug? See the example session below. Thanks for your help

[sage-support] Re: manipulating dictionaries (bug?)

2008-11-04 Thread Justin C. Walker
Hi, Stan, On Nov 4, 2008, at 00:47 , Stan Schymanski wrote: Sorry, I should have looked around a bit more. If I replace pars1 = pars by pars1 = pars.copy() in the below code, the two dictionaries are independent. You found part of the story, but there's a bit more. Consider this

[sage-support] Function similar to Mathematica's Collect ?

2008-11-04 Thread mai
Hi all, is there in SAGE a function similar to Mathematica's Collect ? Thanks a lot, -- Mai --~--~-~--~~~---~--~~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options,

[sage-support] Re: Function similar to Mathematica's Collect ?

2008-11-04 Thread Marshall Hampton
There isn't really, but it would be nice to have one. For the symbolic ring, the coefficients function does a lot of what you might want: var('a,b,x,y') q = (1 + a + x)^4 q.expand().coefficients(a) [[x^4 + 4*x^3 + 6*x^2 + 4*x + 1, 0], [4*x^3 + 12*x^2 + 12*x + 4, 1], [6*x^2 + 12*x + 6, 2], [4*x

[sage-support] Re: time bug?

2008-11-04 Thread William Stein
On Tue, Nov 4, 2008 at 7:40 AM, Georg [EMAIL PROTECTED] wrote: Hi, using sage 3.1.3, the following works fine: sage: def fun(time = 5): : time = RDF(time) : return time : sage: fun(3) 3.0 if you write this function into a script called 'time.sage', loading this

[sage-support] Re: Function similar to Mathematica's Collect ?

2008-11-04 Thread William Stein
On Tue, Nov 4, 2008 at 7:23 AM, mai [EMAIL PROTECTED] wrote: Hi all, is there in SAGE a function similar to Mathematica's Collect ? Thanks a lot, -- Mai Mathematica's Collect is described here: http://reference.wolfram.com/mathematica/ref/Collect.html Sage's coeffs function does

[sage-support] Re: radius of convergence and inequalities

2008-11-04 Thread Stan Schymanski
Dear William Thanks a lot for that. I just signed up for the new sagenb.org notebook and tried out qepcad, but I get a permission error when executing the example from the documentation: ... qepcad('(E x)[a x + b 0]', vars='(a,b,x)') Traceback (click to the left for traceback) ... IOError:

[sage-support] Re: time bug?

2008-11-04 Thread Georg
That definitely looks like a bug in the preparser. Do report it to trac. William Do you mean that I should report it to trac? If yes, no problem, I just never did it, no experience, what priority? what milestone? shall I choose? Georg

[sage-support] Re: manipulating dictionaries (bug?)

2008-11-04 Thread Stan Schymanski
Thanks a lot, Justin! That's good to know. Incidentally, isn't it a bit inconsistent to have different behaviour for assignments related to lists and dictionaries than those related to symbolic variables? Example: sage: L1=[1,2,3];L2=[3,4,5] sage: L=[L1,L2] sage: L [[1, 2, 3], [3, 4, 5]]

[sage-support] Re: manipulating dictionaries (bug?)

2008-11-04 Thread William Stein
On Tue, Nov 4, 2008 at 9:03 AM, Stan Schymanski [EMAIL PROTECTED] wrote: Thanks a lot, Justin! That's good to know. Incidentally, isn't it a bit inconsistent to have different behaviour for assignments related to lists and dictionaries than those related to symbolic variables? The behavior

[sage-support] Re: time bug?

2008-11-04 Thread William Stein
On Tue, Nov 4, 2008 at 8:52 AM, Georg [EMAIL PROTECTED] wrote: That definitely looks like a bug in the preparser. Do report it to trac. William Do you mean that I should report it to trac? Sure. If yes, no problem, I just never did it, no experience, Oops, I didn't realize you

[sage-support] Re: manipulating dictionaries (bug?)

2008-11-04 Thread Stan Schymanski
Hi William, Thanks for the clarification. I think I see a bit of a light in the fog. So since lists and dictionaries are immutable objects, any references to them must always refer to the same thing. Consequently, if the result of the reference is to be changed, the object itself has to

[sage-support] Re: manipulating dictionaries (bug?)

2008-11-04 Thread Stan Schymanski
Sorry, I should have looked around a bit more. If I replace pars1 = pars by pars1 = pars.copy() in the below code, the two dictionaries are independent. Stan Stan Schymanski wrote: Dear all, I tried to store sets of parameter values for plotting in dictionaries, but the dictionaries do

[sage-support] Re: manipulating dictionaries (bug?)

2008-11-04 Thread Robert Bradshaw
I think what William meant to say is that lists and dictionaries are mutable. When you do LL = L, both LL and L point to the same actual list, so things you do to the one are reflected in the other. When you do LL = 2*L, it's making a completely new list. This is a Python thing, not

[sage-support] Re: manipulating dictionaries (bug?)

2008-11-04 Thread Mike Hansen
Hi Stan, On Tue, Nov 4, 2008 at 11:51 AM, Stan Schymanski [EMAIL PROTECTED] wrote: Thanks for the clarification. I think I see a bit of a light in the fog. So since lists and dictionaries are immutable objects, any references to them must always refer to the same thing. William had a typo in

[sage-support] Resize Jmol window + aspect ratio question.

2008-11-04 Thread Tanveer Gani
Is there a way to resize the Jmol window? plot3d doesn't seem to take a size parameter and I couldn't discover any resizing controls on the window even though the Jmol homepage seems to indicate that resizing should be possible. Also, is there a way to set the aspect ratio? E.g. var('t')

[sage-support] Re: Resize Jmol window + aspect ratio question.

2008-11-04 Thread William Stein
On Tue, Nov 4, 2008 at 12:03 PM, Tanveer Gani [EMAIL PROTECTED] wrote: Is there a way to resize the Jmol window? plot3d doesn't seem to take a size parameter You can use the figsize parameter to change the figure size: var('x,y') plot3d(sin(x*y), (x,-pi, pi), (y,-pi,pi),figsize=3) This is a

[sage-support] manipulating dictionaries (bug?)

2008-11-04 Thread Jason Bandlow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Stan, I think I saw one question you asked that hasn't been answered yet: Stan Schymanski wrote: snip If I construct a list out of two other lists, I usually don't expect the original lists to change if I manipulate the resulting list. How

[sage-support] Re: How do you plot equations if one parameter is a list of values ?

2008-11-04 Thread William Stein
On Tue, Nov 4, 2008 at 3:06 PM, kex [EMAIL PROTECTED] wrote: Hi! J is an equation with variables defined in ## my variables What I want to do is plot the J versus x x is a list of values lets say from -100 to 40 so how do I change from x=1 to x=[-100,..,40] and fix this error:

[sage-support] Re: radius of convergence and inequalities

2008-11-04 Thread William Stein
On Tue, Nov 4, 2008 at 1:05 AM, Stan Schymanski [EMAIL PROTECTED] wrote: Dear William Thanks a lot for that. I just signed up for the new sagenb.org notebook and tried out qepcad, but I get a permission error when executing the example from the documentation: ... qepcad('(E x)[a x + b

[sage-support] Re: manipulating dictionaries (bug?)

2008-11-04 Thread Justin C. Walker
Hi, Jason, On Nov 4, 2008, at 14:38 , Jason Bandlow wrote: Hi Stan, I think I saw one question you asked that hasn't been answered yet: Stan Schymanski wrote: snip If I construct a list out of two other lists, I usually don't expect the original lists to change if I manipulate the

[sage-support] Re: Resize Jmol window + aspect ratio question.

2008-11-04 Thread Tanveer Gani
Thanks! Both suggestions worked. However, documentation brought up by tab-completion did not mention figsize or aspect_ratio (tab-completion for show() does mention figsize). The documentation seems to be dated. Tanveer. On Nov 4, 2:29 pm, William Stein [EMAIL PROTECTED] wrote: On Tue, Nov 4,