I'm trying to better format my pandas dataframe output.
I have a series, which I then convert to a dataframe and then output to LaTeX.
meal.to_frame().to_latex('meal.tex') This yields:
\begin{tabular}{lr} \toprule {} & count \\ \midrule Meal & \\ Spam & 11723 \\ Eggs & 5865 \\ \bottomrule \end{tabular} How can I change the \toprule, \midrule, \bottomrule to be \hline. And how can I get the name of the index name model to appear as a column header? The end result I'm looking for is:
\begin{tabular}{lr} \hline Meal & count \\ \hline Spam & 11723 \\ Eggs & 5865 \\ \hline \end{tabular}