def generate_text_description(self, summary_data):

        summary_tables = []
        for (parameter, title) in (
            ('diff_means', 'Difference of Means'),
            ('diff_sdev', 'Difference of S.Dev'),
            ('effect_size', 'Effect Size'),
        ):
            group_summary_header = [
                'Hypothesis', title, 'P.Value', '95% CI Lower', '95% CI Upper']
            group_summary_table_data = [
                [
                    "{} < {}".format(*pair),
                    summary_data[pair]['estimate {}'.format(parameter)],
                    (summary_data[pair]['diff_means'] > 0).mean(),
                    summary_data[pair]['95_CI {}'.format(parameter)][0],
                    summary_data[pair]['95_CI {}'.format(parameter)][1],
                ]
                for pair in self.keys]

            group_summary_table = tabulate(
                group_summary_table_data, group_summary_header, tablefmt="pipe")
            summary_tables.append(group_summary_table)

        summary_tables = "\n\n".join(summary_tables)

        description = output_templates['groups estimate'].format(
            title=self.TYPE,
            groups_header="",
            groups_string="",
            groups_summary=summary_tables,
        )

        return description
dataset/ETHPy150Open HHammond/kcbo/kcbo/statistical_tests/t_test.py/TTest.generate_text_description/original