SyntaxError: invalid syntax

cwentz
Dataiku DSS Core Concepts, Registered Posts: 33 ✭✭✭✭
I ran my code in Jupyter Notebook and wrote my recipe back. Now on the code page, after clicking validate, I get a SyntaxError: invalid syntax for line 8.
%pylab inline
Operating system used: MacOS Monterey 12.6
Answers
-
Miguel Angel Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 118 Dataiker
Hi,
'%pylab' is a magic function in Jupiter notebooks. Magic functions define shortcuts for a series of actions. In this particular case, it triggers the import of various modules within Matplotlib.
However, magic functions will not work outside of a notebook, which is why the code recipe shows a syntax error.
The solution here is to remove the '%pylab inline' line from the code recipe.