%matplotlib inline SyntaxError: invalid syntax

在ipython中运行自己写的.py文件

 

显示dataframe

from IPython.display import display, HTML

然后在代码中调用:

display(df)

对应的解决方案网站:http://stackoverflow.com/questions/26873127/show-dataframe-as-table-in-ipython-notebook

 

在代码中显示plot:

 

使用%matplotlib inline    

出现:SyntaxError: invalid syntax


from IPython import get_ipython
get_ipython().run_line_magic('matplotlib', 'inline')

对应的解决方案网站:http://stackoverflow.com/questions/35595766/matplotlib-line-magic-causes-syntaxerror-in-python-script

 

posted @ 2017-04-05 17:52  youyouhuo  阅读(7383)  评论(1编辑  收藏  举报