I\'m trying to use SymPy to take residues, in this case the cotangent function. I\'ve got an integrate() function:
import sympy as sy
import numpy as np
de
When you get an error message that indicates Python can't count arguments, it's generally because the number of arguments you've passed is equal to the number of required arguments, but you're missing some required arguments and including some optional arguments. In this case, you have the following definition:
def integrate(f, z, gamma, t, lower, upper, exact=True):
and the following call:
integrate(f, z, gamma, 0, 2*sy.pi, exact=True)
If we line them up, we see
def integrate(f, z, gamma, t, lower, upper, exact=True):
integrate(f, z, gamma, 0, 2*sy.pi, exact=True)
that you're missing one of lower
, upper
, or t
, but because you've supplied exact
, the error reporting gets confused.
Python 3 has a better error message for things like this:
>>> def f(a, b=0): pass
...
>>> f(b=1)
Traceback (most recent call last):
File "", line 1, in
TypeError: f() missing 1 required positional argument: 'a'