当前位置: 首页>>代码示例>>Python>>正文


Python MOSES.getRawDataWithFilters方法代码示例

本文整理汇总了Python中MOSES.getRawDataWithFilters方法的典型用法代码示例。如果您正苦于以下问题:Python MOSES.getRawDataWithFilters方法的具体用法?Python MOSES.getRawDataWithFilters怎么用?Python MOSES.getRawDataWithFilters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MOSES的用法示例。


在下文中一共展示了MOSES.getRawDataWithFilters方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: loadData

# 需要导入模块: import MOSES [as 别名]
# 或者: from MOSES import getRawDataWithFilters [as 别名]
    def loadData(self):
        self.load_data_button.setEnabled(False)
        self.alertMessage("Please wait...","Depending on the filters you have chosen, this step could take a second or a minute, though definitely not more than 60s. Please wait, and remember, <i>Roma die uno non aedificata est</i>.")
        self.plot_button.setEnabled(False)
        base_filter = self.base_data_set_group.getFilters()
        comparison_filter = self.comparison_data_set_group.getFilters()
        if self.use_rejected_audits.isChecked():
            self.base_data_set = pd.concat([
                                        MOSES.getRawDataWithFilters(self.user_id, self.password, base_filter),
                                        MOSES.getRawDataWithFilters(self.user_id, self.password, base_filter, rejected=True)
                                        ])
            self.comparison_data_set = pd.concat([
                                        MOSES.getRawDataWithFilters(self.user_id, self.password, comparison_filter),
                                        MOSES.getRawDataWithFilters(self.user_id, self.password, comparison_filter, rejected=True)
                                        ])
        else:
            self.base_data_set = MOSES.getRawDataWithFilters(self.user_id, self.password, base_filter)
            self.comparison_data_set = MOSES.getRawDataWithFilters(self.user_id, self.password, comparison_filter)

        if self.base_data_set is not None:
            base_count = self.base_data_set.shape[0]
        else:
            base_count = 0

        if self.comparison_data_set is not None:
            comparison_count = self.comparison_data_set.shape[0]
        else:
            comparison_count = 0

        if base_count >0:
            self.plot_button.setEnabled(True)
            if comparison_count == 0:
                self.alertMessage("Retrieved Data","Retrieved %d audits for the base filters. There don't seem to be any for the comparison data set. You can go ahead and still plot a chart to analyse the base data, albeit without a reference plotted against it."%(base_count))
            else:
                self.alertMessage("Retrieved Data","Retrieved %d audits matching the base filters and %d audits matching the comparison filters."%(base_count, comparison_count))

        else:
            self.plot_button.setEnabled(False)
            self.alertMessage("Insufficient Base Data","There are no audits matching the selected filters for the base data. It is impossible to plot a chart without base data. This could have occurred for several reasons:\n1. You may have selected too many filters which have no result in the base form, or\n2. You could have selected a date range between which there have been zero audits.")
        self.load_data_button.setEnabled(True)
开发者ID:vinay87,项目名称:oink,代码行数:42,代码来源:TNAViewer.py


注:本文中的MOSES.getRawDataWithFilters方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。