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