python类mean()的实例源码

sl.py 文件源码 项目:SegmentationService 作者: jingchaoluan 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def center1(s):
    return mean([s[1].stop,s[1].start])
sl.py 文件源码 项目:SegmentationService 作者: jingchaoluan 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def center0(s):
    return mean([s[0].stop,s[0].start])
sl.py 文件源码 项目:SegmentationService 作者: jingchaoluan 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def xcenter(s):
    return mean([s[1].stop,s[1].start])
sl.py 文件源码 项目:SegmentationService 作者: jingchaoluan 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def ycenter(s):
    return mean([s[0].stop,s[0].start])
sl.py 文件源码 项目:BinarizationService 作者: jingchaoluan 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def center1(s):
    return mean([s[1].stop,s[1].start])
sl.py 文件源码 项目:BinarizationService 作者: jingchaoluan 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def center0(s):
    return mean([s[0].stop,s[0].start])
sl.py 文件源码 项目:BinarizationService 作者: jingchaoluan 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def xcenter(s):
    return mean([s[1].stop,s[1].start])
sl.py 文件源码 项目:BinarizationService 作者: jingchaoluan 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def ycenter(s):
    return mean([s[0].stop,s[0].start])
sl.py 文件源码 项目:deep_ocr 作者: JinpengLI 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def center1(s):
    return mean([s[1].stop,s[1].start])
sl.py 文件源码 项目:deep_ocr 作者: JinpengLI 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def center0(s):
    return mean([s[0].stop,s[0].start])
sl.py 文件源码 项目:deep_ocr 作者: JinpengLI 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def xcenter(s):
    return mean([s[1].stop,s[1].start])
sl.py 文件源码 项目:deep_ocr 作者: JinpengLI 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def ycenter(s):
    return mean([s[0].stop,s[0].start])
ngamsPlotIngest.py 文件源码 项目:ngas 作者: ICRAR 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def plot(self, output=None):
        """
        Plot the statistics.

        INPUT: None
        OUTPUT: None

        SIDE EFFECTS: Generates a plot, depending on the output mode of pylab
             this may open a ne window.
        """
        fig = pylab.figure()

        ax1 = fig.add_subplot(111)
        ax1.set_xlabel(self.mode[1])
        ax1.set_ylabel('MB/s')
        ax1.set_xlim([0,self.loop+0.5])
        ax1.bar(where(self.y>=0)[0]+0.1,self.y)
        ax1.xaxis.axes.set_autoscalex_on(False)
        ax1.plot([0,self.loop+0.5],[median(self.y[where(self.y > 0)]),
                                    median(self.y[where(self.y > 0)])])
        ax1.plot([0,self.loop+0.5],[mean(self.y[where(self.y > 0)]),
                                    mean(self.y[where(self.y > 0)])])

        pylab.text(0.02,0.95,'Median: %5.2f MB/s'
                   % median(self.y[where(self.y > 0)]),
                   transform = ax1.transAxes,ha='left', va='bottom', color='b',
                   fontsize=10)
        pylab.text(0.02,0.95,'Mean: %5.2f MB/s'
                   % mean(self.y[where(self.y > 0)]),
                   transform = ax1.transAxes,ha='left', va='top', color='g',
                   fontsize=10)

        ax2 = ax1.twinx()
        ax2.xaxis.axes.set_autoscalex_on(False)
        ax2.plot(where(self.n>=0)[0]+0.5,self.n,'r-', marker='o')

        for tl in ax2.get_yticklabels():
            tl.set_color('r')
        ax2.set_ylabel('Number of files',{'color':'r'})

        if self.mode[1] == 'Day':
            fig.canvas.set_window_title('%s: %s' % (self.db,self.date))
            ax2.set_title('%s %s ingest rate: %s' % (self.db, self.mode[0], self.date))
        else:
            fig.canvas.set_window_title('%s: %s' % (self.db,self.date))
            ax2.set_title('%s %s ingest rate: %s' % (self.db, self.mode[0], self.date))

        pylab.text(0.99,0.95,'Total: %5.2f TB' % self.tvol,transform = ax1.transAxes,ha='right', va='bottom')
        pylab.text(0.99,0.95,'Total # files: %8d' % self.tfils,transform = ax1.transAxes,ha='right', va='top')

        if (output is not None):
            fig.savefig(output)
        else:
            fig.show()
        #pl.close(fig)


问题


面经


文章

微信
公众号

扫码关注公众号