m******t 发帖数: 273 | 1 【 以下文字转载自 Quant 讨论区 】
发信人: myregmit (myregmit), 信区: Quant
标 题: calculate an integral in python
发信站: BBS 未名空间站 (Fri Mar 21 09:39:52 2014, 美东)
I need to calculate an integral in python.
I have imported sympy.
g(a,z) = integral_from_z_to_inf of ( t^(a-1) * e^(-1))
in python:
x,a,z = symbols('x a z')
g = integrate(x**(a-1) * exp(-x), z, oo)
I got error:
ValueError: Invalid limits given: (z, oo)
Any help would be appreciated !
Thanks ! |
|