Python-进口上的百分比符号
我正在关注此 tutorial 我尝试过复制该第一个示例的代码。 这是示例上的第一行:
from PIL import Image
import random
import time
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow, show
import matplotlib.animation as animation
#this is crucial to animation in matplotlib
%matplotlib notebook
.
.
.
如您所见,在导入下方,有此行%matplotlib笔记本
。这条线引起了问题,因为它没有被识别为命令。
这是问题描述:陈述期望,找到PY:PERC
和extent of语句预期
我的问题是 - 在这种情况下,百分比符号的含义是什么?它可以工作吗?
I'm following this tutorial and I've tried to copy the code of the first example.
this is the first lines on the example:
from PIL import Image
import random
import time
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.pyplot import imshow, show
import matplotlib.animation as animation
#this is crucial to animation in matplotlib
%matplotlib notebook
.
.
.
As you can see, right underneath the imports, there is this line %matplotlib notebook
. this line is causing a problems because it doesn't recognized as a command.
this is the problem description: Statement expected, found Py:PERC
and End of statement expected
My question is - what is the meaning of the percentage symbol in this case and why doesn't it work?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该语法是jupyter笔记本公约。如果您不使用Jupyter笔记本,则可以删除此行。
This syntax is a Jupyter notebook convention. If you are not using Jupyter notebook, then you can probably remove this line.