2021-02-02 13:07:35 +0100 | received badge | ● Famous Question (source) |
2020-06-10 14:55:10 +0100 | received badge | ● Notable Question (source) |
2018-06-13 22:05:38 +0100 | received badge | ● Popular Question (source) |
2018-06-06 11:41:31 +0100 | received badge | ● Student (source) |
2017-01-07 09:17:28 +0100 | received badge | ● Notable Question (source) |
2017-01-07 09:17:28 +0100 | received badge | ● Popular Question (source) |
2012-08-30 18:14:55 +0100 | answered a question | Way to make default output numerical not symbolic? Wrap with (..).n() at the appropriate stage eg: or: then: |
2012-08-30 17:33:16 +0100 | commented answer | preparser state for regexs No no no .. Something infinitly more diabolical! Experement with two cells as follows Cell one: preparser(False); print type(2) preparser(True); print type(2) Cell two: preparser(True); print type(2) preparser(False); print type(2) preparser(True) Also comment the last and see what happens. I'm totaly confused. I anycase, surely one should leave the preparser in the on state? |
2012-08-30 11:58:18 +0100 | asked a question | preparser state for regexs I would have expected the following to work: In fact I get 'IndexError: no such group'. Using int(1) fixes the problem, but why? The preparser is off! Even more curious the block works, as is, on every other evaluate! I tried moving the preparser(False) statement to before the import, but that makes no difference. |
2012-08-27 10:44:12 +0100 | commented answer | How do I exec a function of N variables. Can't quite see how to "accept". Is it a thumbs up or a tick or something else? |
2012-08-27 10:41:49 +0100 | received badge | ● Scholar (source) |
2012-08-27 10:41:49 +0100 | marked best answer | How do I exec a function of N variables. Usually needing to use The problem is that you're using Sage-specific syntax handles by the Sage prepareser and or by using the alternate function syntax: where you'd have to make sure the variables were defined somewhere. |
2012-08-27 10:41:47 +0100 | received badge | ● Supporter (source) |
2012-08-23 18:57:54 +0100 | received badge | ● Teacher (source) |
2012-08-23 18:30:59 +0100 | answered a question | Multiple loops in an animation? Does this give you a clue? Is this what you want to achieve? I'm not sure. |
2012-08-22 15:56:11 +0100 | answered a question | How do I exec a function of N variables. Is an embedded exec any more insecure than a live session in which anyone could just write one? |
2012-08-22 15:52:00 +0100 | commented answer | How do I exec a function of N variables. Nice answer thanks. |
2012-08-21 14:49:37 +0100 | asked a question | How do I exec a function of N variables. The python code: f(x,y)=sin(x) + cos(y) Can be both differentiated and evaluated. like this: dfx=diff(f,x); dfy=diff(f,y) then evaluated like this: f(pi/6,pi/9) -> cos(1/9pi) + 1/2 dfx(pi/6,pi/9) -> 1/2sqrt(3) I'm wanting to do something like: exec("f(t1,t2)=cos(t1)+sin(t2)") so that I can write an @interact function to define the equations of N variables interactively. When I try the above exec I receive the error: "SyntaxError: can't assign to function call" I can almost do it, but I'm getting into a horrible inelegant tangle of of eval statements in the process! Is there a clean way to do it with sage? |