1 | initial version |

Hi,

Sage is based on Python. This error comes from numpy.var function (variance calculation on numeric array) like numpy.var([1,2,3]) = 0.6666666666663. I had the same problem because I use a pythonrc.py file which import all from numpy (from numpy import *) each time I start a python console. Commenting this import will solve the problem and Sage will recognize the var function (which comes from sympy.var, var as variable not variance).

So in Sage : x=var('x') won't produce any error and it works fine.

Another solution is to "import numpy as np" or simply "import numpy" to make sure we don't overwrite "variable" with "variance".

;)

2 | No.2 Revision |

Hi,

Sage is based on Python. This error comes from numpy.var function (variance calculation on numeric array) like numpy.var([1,2,3]) = 0.6666666666663. I had the same problem because I use a pythonrc.py file which import all from numpy (from numpy import *) each time I start a python console. Commenting this import will solve the problem and Sage will recognize the var function (which comes from sympy.var, var as variable not variance).

So in Sage : x=var('x') won't produce any error and it works fine.

Another solution is to "import numpy as np" or simply "import numpy" to make sure we don't overwrite "variable" with "variance".

;)

bigduke

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.