Dear all,

I am new to SymPy and trying to learning how to use.
I have installed the latest SymPy (v. 0.6.7) and tried the following
Python script:

sympy_test.py

from sympy import Symbol
from math import *

x = Symbol('x')
i = 0
prior = 1 / sqrt(2*pi) * exp(-1*x**2 / 2)
p = 1 / (1 + exp(-1*discriminations[i]*(x - difficulties[1])))
q = 1 - p
posterior = prior * q
print posterior

But, when I ran this Python code, I got the following error message:
Traceback (most recent call last):
  File "/Applications/eclipse/plugins/
org.python.pydev.debug_1.5.7.2010050621/pysrc/pydevd.py", line 978, in
<module>
    debugger.run(setup['file'], None, None)
  File "/Applications/eclipse/plugins/
org.python.pydev.debug_1.5.7.2010050621/pysrc/pydevd.py", line 780, in
run
    execfile(file, globals, locals) #execute the script
  File "/Users/yjlee/Documents/Worx/EclipseWorx/SymPyProjects/src/
sympy_test.py", line 44, in <module>
    prior = 1 / sqrt(2*pi) * exp(-1*x**2 / 2)
  File "/Library/Python/2.6/site-packages/sympy/core/basic.py", line
2103, in __float__
    raise ValueError("Symbolic value, can't compute")
ValueError: Symbolic value, can't compute

All I was trying to do was to get a product of two functions, and I
could not figure out what I did wrong.

Could anyone tell me what I did wrong?

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
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/sympy?hl=en.

Reply via email to