remove center and clean tabular_latex for Dataset
This commit is contained in:
parent
03e304ac43
commit
0180f5a37f
@ -316,10 +316,7 @@ On a ainsi $Q_{q} = {val_q}$
|
|||||||
return latex
|
return latex
|
||||||
|
|
||||||
def tabular_latex(self, nbr_lines = 1):
|
def tabular_latex(self, nbr_lines = 1):
|
||||||
""" Renvoie le code latex pour afficher le tableau
|
""" Latex code to display dataset as a tabular """
|
||||||
|
|
||||||
:return : le code latex pour afficher le tableau
|
|
||||||
"""
|
|
||||||
d_per_line = self.effectif_total() // nbr_lines
|
d_per_line = self.effectif_total() // nbr_lines
|
||||||
d_last_line = self.effectif_total() % d_per_line
|
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)]
|
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)
|
splited_data[-1] += [' ']*(d_per_line - d_last_line)
|
||||||
|
|
||||||
# Construction du tableau
|
# 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"
|
latex += "\t\t \hline \n"
|
||||||
|
|
||||||
d_lines = [' & '.join(map(str,l)) for l in splited_data]
|
d_lines = [' & '.join(map(str,l)) for l in splited_data]
|
||||||
latex += " \\\\ \n \\hline \n".join(d_lines)
|
latex += " \\\\ \n \\hline \n".join(d_lines)
|
||||||
|
|
||||||
latex += " \\\\ \n \\hline \n"
|
latex += " \\\\ \n \\hline \n"
|
||||||
latex += "\t \\end{tabular} \n \\end{center}"
|
latex += "\\end{tabular}"
|
||||||
|
|
||||||
return latex
|
return latex
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user