python - TypeError: bad operand type for abs(): 'list' -
the following simple code returns: typeerror: bad operand type abs(): 'list'
from scipy.signal import residue def x_filter(): p = [complex(-2505.707527665261,3165.104073896715),complex(-2505.707527665261,-3165.104073896715),complex(-3449.516723926777,1032.914743287806),complex(-3449.516723926777,-1032.914743287806)] r = [complex(-1981.17378001573,2672.79673635191),complex(-1981.17378001573,-2672.79673635191),complex(1981.17378001573,-10000.37025226017),complex(1981.17378001573,10000.37025226017)] k = [] [b,a]=residue(r,p,k) filtered = x_filter()
i replaced p , r with:
p = [-2505.707527665261+3165.104073896715j,-2505.707527665261-3165.104073896715j,-3449.516723926777+1032.914743287806j,-3449.516723926777-1032.914743287806j] r = [-1981.17378001573+2672.79673635191j,-1981.17378001573-2672.79673635191j,1981.17378001573-10000.37025226017j,1981.17378001573+10000.37025226017j]
..., makes no difference.
am doing wrong? there workaround?
i referred bad operand type abs(): 'list', cannot apply solution because __builtin__.abs() function used in scipy.signal.residue (not in code).
looking @ docs docs, seems mistook inputs outputs. residue
takes a , b , returns r, p , k.
third parameter (tol) should number passing list.
you might using wrong method. take @ scipy.signal.invres, should looking for.
Comments
Post a Comment