Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python SyntaxError: positional argument follows keyword argument [duplicate]

I have a python 3 function which is defined like below:

def hidden_markov_model(distribution, K=3, N=100, *args):

when i call the function, i get this error:

Q_hmm = hidden_markov_model(Gaussian, K=K, N=N, 
                            mu, K*[std**(-2)*np.identity(2)],
                            )

SyntaxError: positional argument follows keyword argument

what is wrong?

like image 711
Atena Avatar asked Jan 06 '17 11:01

Atena


1 Answers

Understand. I should call it like this:

 Q_hmm = hidden_markov_model(Gaussian, K, N, 
                            mu, K*[std**(-2)*np.identity(2)],
                            )
like image 54
Atena Avatar answered Oct 19 '22 16:10

Atena