[Tutor] something about sum, integer and delta function
alan.gauld at btinternet.com
Sun Jan 15 17:34:51 CET 2012
On 15/01/12 13:57, lina wrote:
> are there some modules can be used to do below things like:
> sum and delta function, and intergeration.
Not exactly but there are a number of numerical methods that can be used
to get close approximations. Those have been implemented in a number of
standard libraries and there are Python wrappers for most of them.
The down side is you really need to understand the math behind them to
use them effectively. It's not possible to simply translate the example
expression you gave directly into a Python expression.
For simple summations there are things like sum(), map() and reduce()
And there are other helper functions available like any() and others in
the itertools module.
Author of the Learn to Program web site
More information about the Tutor