SageCell Doctor
 Share
The version of the browser you are using is no longer supported. Please upgrade to a supported browser.Dismiss

View only
 
 
BCDEFGHI
1
Sample code that stopped working
Error messageSolutionCommentsWorks inFails in
2
print "a", "b"SyntaxError: Missing parentheses in call to 'print'.print("a","b")see https://wiki.sagemath.org/Python3-user#A1._print
3
show(LatexExpr("a \cdot b"))DeprecationWarning: invalid escape sequence \cUse \\: show(LatexExpr("a \\cdot b"))
4
data = [random() for i in [1 .. 20]]
std(data)
AttributeError: 'float' object has no attribute 'sqrt'Use data = random_vector(RR, 20) for generating a random vectorsee https://trac.sagemath.org/ticket/29184
5
factorial(float(3.2))AttributeError: 'float' object has no attribute 'gamma'see https://trac.sagemath.org/ticket/26749Sage <= 8.2Sage 8.3 .. 9.0
6
R-Cell:
x<-list(daten=c(34.6,34.5,28.6))
x$median<-median(x$daten)
cat("Median: ",x$median,"\n")
NULL in output,
no error message
7
v1=vector([1,2,3])
v2=vector([4,5,6])
p1=plot(v1)
p2=plot(v2,color='red')
p1+p2
None
No arrow heads, all in blue
8
html("$X \cap Y$ = %s"%f(XY)) from https://wiki.sagemath.org/interact/misc#An_Interactive_Venn_DiagramDeprecationWarning: invalid escape sequence \cDuplicate of line 3 - replace \cap with \\cap
9
var('a,b,c,d,x,y,z')
qf = qepcad_formula
ellipse = 3*x^2 + 2*x*y + y^2 - x + y - 7
F = qf.exists(y, ellipse == 0); F
qepcad(F)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-b25bf9b29376> in <module>()
3 ellipse = Integer(3)*x**Integer(2) + Integer(2)*x*y + y**Integer(2) - x + y - Integer(7)
4 F = qf.exists(y, ellipse == Integer(0)); F
----> 5 qepcad(F)

/home/sc_serv/sage/local/lib/python3.7/site-packages/sage/interfaces/qepcad.py in qepcad(formula, assume, interact, solution, vars, **kwargs)
1639 qe.go()
1640 if solution is None:
-> 1641 qe.finish()
1642 return qe.answer()
1643 elif solution == 'geometric':

/home/sc_serv/sage/local/lib/python3.7/site-packages/sage/interfaces/qepcad.py in __call__(self, *args)
1416 "interactive commands not handled")
1417
-> 1418 return self._parent._function_call(self._name, args)
1419
1420

/home/sc_serv/sage/local/lib/python3.7/site-packages/sage/interfaces/qepcad.py in _function_call(self, name, args)
1324 if pre_phase != post_phase:
1325 if post_phase == 'EXITED' and name != 'quit':
-> 1326 return self.answer()
1327 return AsciiArtString("QEPCAD object has moved to phase '%s'"%post_phase)
1328

/home/sc_serv/sage/local/lib/python3.7/site-packages/sage/interfaces/qepcad.py in answer(self)
1123 {'x + 1 = 0', 'x + 1 >= 0', 'x - 1 <= 0', 'x - 1 = 0', 'x = 0'}
1124 """
-> 1125 return AsciiArtString(self._parse_answer_stats()[0])
1126
1127 def final_stats(self):

/home/sc_serv/sage/local/lib/python3.7/site-packages/sage/interfaces/qepcad.py in _parse_answer_stats(self)
1091 raise ValueError("QEPCAD is not finished yet")
1092 final = self._qex.expect().before
-> 1093 match = re.search('\nAn equivalent quantifier-free formula:(.*)\n=+ The End =+\r\n\r\n(.*)$', final, re.DOTALL)
1094
1095 if match:

/home/sc_serv/sage/local/lib/python3.7/re.py in search(pattern, string, flags)
181 """Scan through string looking for a match to the pattern, returning
182 a Match object, or None if no match was found."""
--> 183 return _compile(pattern, flags).search(string)
184
185 def sub(pattern, repl, string, count=0, flags=0):

TypeError: cannot use a string pattern on a bytes-like object
10
x = var('x')
y = function('y')(x)
t=function('y^2')
desolve(diff(t,x)-x-t,t)
TypeError: unable to convert y^2 to a symbolic expression
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Loading...