python - Syntax error while defining function, code works fine -


using spyder 3.5.1 python 3.5 on mac.

i can't load function in workspace because of syntax error, though line causing error works fine if ran in console alone. notice same function did not return issue on windows machine.

here line of code

sel = np.random.choice([false, true], size=(len(cl),), p=[1-pct, pct])

where pct number 0 1 , cl pandas dataframe. same line returns true/false vector of correct length if ran console.

i've checked similar questions , indenting/parenthesis still can't find reason.

many thanks!


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -