本文整理汇总了Python中cis.stats.StatsAnalyzer.analyze方法的典型用法代码示例。如果您正苦于以下问题:Python StatsAnalyzer.analyze方法的具体用法?Python StatsAnalyzer.analyze怎么用?Python StatsAnalyzer.analyze使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cis.stats.StatsAnalyzer
的用法示例。
在下文中一共展示了StatsAnalyzer.analyze方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: stats_cmd
# 需要导入模块: from cis.stats import StatsAnalyzer [as 别名]
# 或者: from cis.stats.StatsAnalyzer import analyze [as 别名]
def stats_cmd(main_arguments):
"""
Main routine for handling calls to the statistics command.
:param main_arguments: The command line arguments (minus the stats command)
"""
from cis.stats import StatsAnalyzer
from cis.data_io.gridded_data import GriddedDataList
data_reader = DataReader()
data_list = data_reader.read_datagroups(main_arguments.datagroups)
analyzer = StatsAnalyzer(*data_list)
results = analyzer.analyze()
header = "RESULTS OF STATISTICAL COMPARISON:"
note = "Compared all points which have non-missing values in both variables"
header_length = max(len(header), len(note))
print(header_length * '=')
print(header)
print(header_length * '-')
print(note)
print(header_length * '=')
for result in results:
print(result.pprint())
if main_arguments.output:
cubes = GriddedDataList([result.as_cube() for result in results])
variables = []
filenames = []
for datagroup in main_arguments.datagroups:
variables.extend(datagroup['variables'])
filenames.extend(datagroup['filenames'])
history = "Statistical comparison performed using CIS version " + __version__ + \
"\n variables: " + str(variables) + \
"\n from files: " + str(set(filenames))
cubes.add_history(history)
cubes.save_data(main_arguments.output)
示例2: test_GIVEN_missing_values_WHEN_analyze_THEN_original_data_unchanged
# 需要导入模块: from cis.stats import StatsAnalyzer [as 别名]
# 或者: from cis.stats.StatsAnalyzer import analyze [as 别名]
def test_GIVEN_missing_values_WHEN_analyze_THEN_original_data_unchanged(self):
# We perform some manipulation on the data masks, but we don't want the
# original data to be changed.
stats = StatsAnalyzer(self.missing1, self.missing2)
results = stats.analyze()
assert_that(len(self.missing1.data.compressed()), is_(7))
assert_that(len(self.missing2.data.compressed()), is_(7))
示例3: test_GIVEN_flattened_and_unflattened_datasets_WHEN_analyze_THEN_StatisticsResults_returned
# 需要导入模块: from cis.stats import StatsAnalyzer [as 别名]
# 或者: from cis.stats.StatsAnalyzer import analyze [as 别名]
def test_GIVEN_flattened_and_unflattened_datasets_WHEN_analyze_THEN_StatisticsResults_returned(self):
data1 = mock.make_regular_2d_ungridded_data()
data2 = mock.make_regular_2d_ungridded_data()
data2._data = data2.data_flattened
for coord in data2.coords():
coord._data = coord.data_flattened
stats = StatsAnalyzer(data1, data2)
results = stats.analyze()
assert_that(len(results), is_(14))
示例4: test_GIVEN_datasets_WHEN_analyze_THEN_StatisticsResults_returned
# 需要导入模块: from cis.stats import StatsAnalyzer [as 别名]
# 或者: from cis.stats.StatsAnalyzer import analyze [as 别名]
def test_GIVEN_datasets_WHEN_analyze_THEN_StatisticsResults_returned(self):
stats = StatsAnalyzer(self.data1, self.data2)
results = stats.analyze()
assert_that(len(results), is_(14))