Weak 1 MLS lab C1_W1_Lab03_Cost_function_Soln

In Lab C1_W1_Lab03_Cost_function_Soln why we are using →

%matplotlib widget

these two line??
can anyone give me answer for this pls.

The % is a python symbol for a single line magic command (search about it). What is actually happening here is using widgets from matplotlib and a certain style found in the directory file given in the second line.

1 Like

thaku for your response

The %matplotlib syntax causes the output from matplotlib to be embedded in the notebook.

If you search for “magic commands”, you’ll get a lot of explanations about the “double_underscore” (dunder) syntax that Python uses internally to define default built-in functions. That has naught to do with the % inline syntax.