本文整理汇总了Python中terminaltables.AsciiTable.justify_columns[6]方法的典型用法代码示例。如果您正苦于以下问题:Python AsciiTable.justify_columns[6]方法的具体用法?Python AsciiTable.justify_columns[6]怎么用?Python AsciiTable.justify_columns[6]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类terminaltables.AsciiTable
的用法示例。
在下文中一共展示了AsciiTable.justify_columns[6]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: str
# 需要导入模块: from terminaltables import AsciiTable [as 别名]
# 或者: from terminaltables.AsciiTable import justify_columns[6] [as 别名]
diffs = []
table_data = []
table_data.append(["Benchmark", "prev. iter/s", "runs", "new iter/s", "runs", "change [%]", "p-value (significant if <" + str(p_value_significance_threshold) + ")"])
for old, new in zip(old_data['benchmarks'], new_data['benchmarks']):
name = old['name']
if old['name'] != new['name']:
name += ' -> ' + new['name']
if float(old['items_per_second']) > 0.0:
diff = float(new['items_per_second']) / float(old['items_per_second'])
diffs.append(diff)
else:
diff = float('nan')
diff_formatted = format_diff(diff)
p_value_formatted = calculate_and_format_p_value(old, new)
table_data.append([name, str(old['items_per_second']), str(len(old['metrics'])), str(new['items_per_second']), str(len(new['metrics'])), diff_formatted, p_value_formatted])
table_data.append(['geometric mean', '', '', '', '', format_diff(geometric_mean(diffs)), ''])
table = AsciiTable(table_data)
table.justify_columns[6] = 'right'
print("")
print(table.table)
print("")