>>> %matplotlib inline results in SyntaxError: invalid syntax

MRAB python at mrabarnett.plus.com
Mon Dec 25 15:41:47 EST 2023


On 2023-12-25 19:53, Alan Gauld via Python-list wrote:
> On 25/12/2023 05:34, geetanajali homes via Python-list wrote:
> 
>>> import numpy as np 
>>> import pandas as pd 
>>> import random 
>>> import matplotlib.pyplot as plt 
>>> %matplotlib inline 
>>>
>>> I get an error on the last line. I am running this code in Idle Python 
>>> 3.4.4 Shell... 
> 
> Python names can't start with a % (its the modulo or
> string formatting operator).
> 
> I know nothing of the innards of matplotlib so I can only
> suggest a closer examination of their tutorial information.
> 
I believe it's a feature of Jupyter specifically. It won't work in IDLE.


More information about the Python-list mailing list