팬더 데이터 프레임 출력을 더 형식화하려고합니다.python pandas LaTeX 출력 형식을 어떻게 변경합니까?
나는 데이터 프레임으로 변환 한 다음 LaTeX로 출력하는 시리즈가 있습니다.
meal.to_frame().to_latex('meal.tex')
이 수율 다음 \toprule
이 \midrule
, \bottomrule
이 \hline
로
\begin{tabular}{lr}
\toprule
{} & count \\
\midrule
Meal & \\
Spam & 11723 \\
Eggs & 5865 \\
\bottomrule
\end{tabular}
어떻게 변경할 수 있습니다. 그리고 인덱스 이름 인 model
의 이름을 열 헤더로 표시하려면 어떻게해야합니까? 내가 찾고있는 최종 결과는 다음과 같습니다.
\begin{tabular}{lr}
\hline
Meal & count \\
\hline
Spam & 11723 \\
Eggs & 5865 \\
\hline
\end{tabular}