Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #102217
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: >>> %matplotlib inline results in SyntaxError: invalid syntax |
| Date | 2016-01-29 18:32 +1100 |
| Message-ID | <mailman.78.1454052780.2338.python-list@python.org> (permalink) |
| References | <n8f2ol$fis$1@dont-email.me> |
On Fri, Jan 29, 2016 at 6:04 PM, Mike S via Python-list <python-list@python.org> wrote: > > I get an error on the last line. I am running this code in Idle Python 3.4.4 > Shell... > > Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit > (Intel)] on win32 > Type "copyright", "credits" or "license()" for more information. >>>> import numpy as np >>>> import pandas as pd >>>> import random >>>> import matplotlib.pyplot as plt >>>> %matplotlib inline > SyntaxError: invalid syntax > > What am I doing wrong? Suggested reading? That's a magic command for ipython - it's not actual Python syntax. You can either install ipython and do the exercises there, or continue with Idle and accept that things will be slightly different. Skim through a few more of the examples; do you see more lines starting with percent signs? If not, you can probably get away with using any interactive Python interpreter (including Idle as you're using above). Alternatively, take the certain route and install ipython - then everything should work. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
>>> %matplotlib inline results in SyntaxError: invalid syntax Mike S <mscir@yahoo.com> - 2016-01-28 23:04 -0800
Re: >>> %matplotlib inline results in SyntaxError: invalid syntax Chris Angelico <rosuav@gmail.com> - 2016-01-29 18:32 +1100
Re: >>> %matplotlib inline results in SyntaxError: invalid syntax Steven D'Aprano <steve@pearwood.info> - 2016-01-29 18:57 +1100
Re: >>> %matplotlib inline results in SyntaxError: invalid syntax Mike S <mscir@yahoo.com> - 2016-01-29 00:10 -0800
csiph-web