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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -