From 0180f5a37fbd3542b2bddb5c84ec92134f7d8523 Mon Sep 17 00:00:00 2001 From: Benjamin Bertrand Date: Sat, 9 Jan 2016 13:20:20 +0300 Subject: [PATCH] remove center and clean tabular_latex for Dataset --- pymath/stat/dataset.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pymath/stat/dataset.py b/pymath/stat/dataset.py index dd5b9fc..1c104b6 100644 --- a/pymath/stat/dataset.py +++ b/pymath/stat/dataset.py @@ -316,10 +316,7 @@ On a ainsi $Q_{q} = {val_q}$ return latex def tabular_latex(self, nbr_lines = 1): - """ Renvoie le code latex pour afficher le tableau - - :return : le code latex pour afficher le tableau - """ + """ Latex code to display dataset as a tabular """ d_per_line = self.effectif_total() // nbr_lines d_last_line = self.effectif_total() % d_per_line splited_data = [self[x:x+d_per_line] for x in range(0, self.effectif_total(), d_per_line)] @@ -328,14 +325,14 @@ On a ainsi $Q_{q} = {val_q}$ splited_data[-1] += [' ']*(d_per_line - d_last_line) # Construction du tableau - latex = "\\begin{{center}} \n \t \\begin{{tabular}}{{|c|*{{{nbr_col}}}{{c|}}}} \n".format(nbr_col = d_per_line) + latex = "\\begin{{tabular}}{{|c|*{{{nbr_col}}}{{c|}}}} \n".format(nbr_col = d_per_line) latex += "\t\t \hline \n" d_lines = [' & '.join(map(str,l)) for l in splited_data] latex += " \\\\ \n \\hline \n".join(d_lines) latex += " \\\\ \n \\hline \n" - latex += "\t \\end{tabular} \n \\end{center}" + latex += "\\end{tabular}" return latex