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' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -