Python nested parenthesis function parameter list invalid syntax -


the code page chaotic attractor reconstruction. returns error when running under python 3.4.4 follows:

syntaxerror: invalid syntax 

at 2nd opening parenthesis in parameter part of function:

def rossler_odes((x, y, z), (a, b, c)):     return numpy.array([-y - z, x + * y, b + z * (x - c)]) 

i guessing python version issue e.g. code created version older 3.4.4. not know python wish run learn physics , of course language.

tuple parameter unpacking has been removed in python 3, see pep 3113, what's new in python 3.0. suggested there, easiest way make code python 2/3 compatible use

def rossler_odes(x_y_z, a_b_c):     x, y, z = x_y_z     a, b, c = a_b_c     return numpy.array([-y - z, x + * y, b + z * (x - c)]) 

Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -