本文整理匯總了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)