本文整理汇总了Python中Features.calc_mean方法的典型用法代码示例。如果您正苦于以下问题:Python Features.calc_mean方法的具体用法?Python Features.calc_mean怎么用?Python Features.calc_mean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Features
的用法示例。
在下文中一共展示了Features.calc_mean方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: timer_event
# 需要导入模块: import Features [as 别名]
# 或者: from Features import calc_mean [as 别名]
def timer_event(self):
# get next window
try:
## XXX MARIO
# data = self.data.next()
data = self.data.next_in_selection()
# --> video finished
except StopIteration:
return
y = data.points
x = range(len(y))
## remove old line
try:
old_line = self.lines.popleft()
## XXX MARIO
for l in old_line:
self.ax.lines.remove(l)
# --> no old lines, so we don't have to remove any
except IndexError:
pass
## * draw new line *
line = self.ax.plot( x, y, self.line_type, c=data.color )
self.lines.append(line)
## draw label
# self.label = self.ax.text(0.02, 0.98, data.label,
# horizontalalignment='left',
# verticalalignment='top',
# color=data.color,
# transform = self.ax.transAxes)
self.label.set_text(data.label)
self.label.set_color(data.color)
## progress
self.status_label.set_text(str(data.progress[0]) + " / " + str(data.progress[1])
+ ", " + data.label )
print data.label, Features.calc_mean(y)
plt.draw()
## XXX
if ( data.label in ("up", "down")):
time.sleep(2)
## set new timer
self._set_timer(self.speed)