@staticmethod
    def print_table(results):
        names = sorted(set(r[0] for r in results.keys()))

        col_width = max(max(len(n) for n in names), 5)

        for h in chain([""], names):
            print('{:{width}}'.format(h, width=col_width), end='|')
        print()

        for name in names:
            print('{:{width}}'.format(name, width=col_width), end='|')

            for name2 in names:
                print('{:{width}.5}'.format(results[(name, name2)],
                                            width=col_width), end='|')
            print()
Nicely format a results table as returned by significance_test
dataset/ETHPy150Open aalto-speech/morfessor/morfessor/evaluation.py/WilcoxonSignedRank.print_table