statistics.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Eskapade 作者: KaveIO 项目源码 文件源码
def get_latex_table(self, get_stats=None):
        """Get LaTeX code string for group-by table of stats values

        :param list get_stats: same as ArrayStats.get_latex_table get_stats key word.
        :returns str: LaTeX code snippet
        """

        # Explicitly strip the tables of their LaTeX headers and footers, concatenate the strings with a group-header
        # and reattach the LaTeX header and footer so that it parses to proper LaTeX.
        self.table = []
        for group_key in sorted(self.stats_obj.keys()):
            s = self.stats_obj.get(group_key).get_latex_table(get_stats=get_stats, latex=False)
            self.table = self.table + [[group_key]] + s  # The double list is needed for proper latex parsing

        if len(self.table) > 25:
            self.log().warning('The table is longer than 25 rows, the latex file will overflow.')

        return tabulate.tabulate(self.table, tablefmt='latex')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号