首页 > 编程语言 > 详细

python 中问题,包括某些库的问题

时间:2019-07-28 13:13:41      阅读:52      评论:0      收藏:0      [点我收藏+]

*)matplotlib animate中变量作用域的问题

错误提示:

UnboundLocalError: local variable ‘i‘ referenced before assignment

  代码:

i=0
def animate(frameno):

    x = mu + sigma * np.random.randn(N)
    n, _ = np.histogram(x, bins, normed=True)
    time_text.set_text(time_template%frameno)
    i+=1
    for rect, h in zip(patches, n):
        rect.set_height(h)
    return patches

  

python 中问题,包括某些库的问题

原文:https://www.cnblogs.com/Gaoqiking/p/11258442.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!